@@ 89-100 (lines=12) @@ | ||
86 | * @expectedException \InvalidArgumentException |
|
87 | * @covers \SWP\Bundle\MultiTenancyBundle\Command\CreateOrganizationCommand |
|
88 | */ |
|
89 | public function testExecuteWhenDefaultTenantExists() |
|
90 | { |
|
91 | $organization = new Organization(); |
|
92 | $organization->setCode('123456'); |
|
93 | $this->command->setContainer($this->getMockContainer($organization)); |
|
94 | $this->commandTester = new CommandTester($this->command); |
|
95 | ||
96 | $this->commandTester->execute([ |
|
97 | 'command' => $this->command->getName(), |
|
98 | '--default' => true, |
|
99 | ]); |
|
100 | } |
|
101 | ||
102 | /** |
|
103 | * @covers \SWP\Bundle\MultiTenancyBundle\Command\CreateOrganizationCommand |
@@ 100-115 (lines=16) @@ | ||
97 | * @covers \SWP\Bundle\MultiTenancyBundle\Command\CreateTenantCommand |
|
98 | * @expectedException \InvalidArgumentException |
|
99 | */ |
|
100 | public function testExecuteWhenCreatingDefaultTenantAndDefaultOrganizationDoesntExist() |
|
101 | { |
|
102 | $container = $this->getMockContainer(); |
|
103 | $this->setupCommand($container); |
|
104 | $this->commandTester = new CommandTester($this->command); |
|
105 | ||
106 | $this->commandTester->execute([ |
|
107 | 'command' => $this->command->getName(), |
|
108 | '--default' => true, |
|
109 | ]); |
|
110 | ||
111 | $this->assertRegExp( |
|
112 | '/Default organization doesn\'t exist!/', |
|
113 | $this->commandTester->getDisplay() |
|
114 | ); |
|
115 | } |
|
116 | ||
117 | /** |
|
118 | * @expectedException \InvalidArgumentException |