| @@ 57-71 (lines=15) @@ | ||
| 54 | /** |
|
| 55 | * @covers SWP\Bundle\MultiTenancyBundle\Command\CreateOrganizationCommand |
|
| 56 | */ |
|
| 57 | public function testExecuteWhenCreatingDefaultOrganization() |
|
| 58 | { |
|
| 59 | $this->command->setContainer($this->getMockContainer(null, new Organization())); |
|
| 60 | $this->commandTester = new CommandTester($this->command); |
|
| 61 | ||
| 62 | $this->commandTester->execute([ |
|
| 63 | 'command' => $this->command->getName(), |
|
| 64 | '--default' => true, |
|
| 65 | ]); |
|
| 66 | ||
| 67 | $this->assertRegExp( |
|
| 68 | '/Organization default has been created and enabled!/', |
|
| 69 | $this->commandTester->getDisplay() |
|
| 70 | ); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * @expectedException \InvalidArgumentException |
|
| @@ 82-96 (lines=15) @@ | ||
| 79 | * @covers SWP\Bundle\MultiTenancyBundle\Command\CreateTenantCommand |
|
| 80 | * @expectedException \InvalidArgumentException |
|
| 81 | */ |
|
| 82 | public function testExecuteWhenCreatingDefaultTenantAndDefaultOrganizationDoesntExist() |
|
| 83 | { |
|
| 84 | $this->command->setContainer($this->getMockContainer()); |
|
| 85 | $this->commandTester = new CommandTester($this->command); |
|
| 86 | ||
| 87 | $this->commandTester->execute([ |
|
| 88 | 'command' => $this->command->getName(), |
|
| 89 | '--default' => true, |
|
| 90 | ]); |
|
| 91 | ||
| 92 | $this->assertRegExp( |
|
| 93 | '/Default organization doesn\'t exist!/', |
|
| 94 | $this->commandTester->getDisplay() |
|
| 95 | ); |
|
| 96 | } |
|
| 97 | ||
| 98 | /** |
|
| 99 | * @expectedException \InvalidArgumentException |
|