Completed
Push — master ( dcdc51...16ea71 )
by Aimeos
03:11
created

AccountCommandTest::testAccountCommandAdmin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 14
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
namespace Aimeos\ShopBundle\Tests\Command;
4
5
6
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7
use Symfony\Bundle\FrameworkBundle\Console\Application;
8
use Symfony\Component\Console\Tester\CommandTester;
9
use Aimeos\ShopBundle\Command;
10
11
12
class AccountCommandTest extends WebTestCase
13
{
14
	public function testAccountCommandNew()
15
	{
16
		$kernel = $this->createKernel();
17
		$kernel->boot();
18
19
		$application = new Application( $kernel );
20
		$application->add( new Command\AccountCommand() );
21
22
		$command = $application->find( 'aimeos:account' );
23
		$commandTester = new CommandTester( $command );
24
		$commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'email' => '[email protected]', '--password' => 'test' ) );
25
26
		$this->assertEquals( 0, $commandTester->getStatusCode() );
27
	}
28
29
30
	public function testAccountCommandAdmin()
31
	{
32
		$kernel = $this->createKernel();
33
		$kernel->boot();
34
35
		$application = new Application( $kernel );
36
		$application->add( new Command\AccountCommand() );
37
38
		$command = $application->find( 'aimeos:account' );
39
		$commandTester = new CommandTester( $command );
40
		$commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'email' => '[email protected]', '--password' => 'test', '--admin' => true ) );
41
42
		$this->assertEquals( 0, $commandTester->getStatusCode() );
43
	}
44
}
45