|
@@ 37-48 (lines=12) @@
|
| 34 |
|
/** |
| 35 |
|
* @covers SWP\MultiTenancyBundle\Command\CreateTenantCommand |
| 36 |
|
*/ |
| 37 |
|
public function testExecuteWhenCreatingNewTenant() |
| 38 |
|
{ |
| 39 |
|
$this->dialog->setInputStream($this->getInputStream("subdomain\nTest\n")); |
| 40 |
|
$this->command->setContainer($this->getMockContainer(null, 'subdomain')); |
| 41 |
|
$this->commandTester = new CommandTester($this->command); |
| 42 |
|
$this->commandTester->execute(array('command' => $this->command->getName())); |
| 43 |
|
|
| 44 |
|
$this->assertRegExp( |
| 45 |
|
'/Please enter subdomain:Please enter name:Tenant Test has been created and enabled!/', |
| 46 |
|
$this->commandTester->getDisplay() |
| 47 |
|
); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
/** |
| 51 |
|
* @covers SWP\MultiTenancyBundle\Command\CreateTenantCommand |
|
@@ 90-104 (lines=15) @@
|
| 87 |
|
/** |
| 88 |
|
* @covers SWP\MultiTenancyBundle\Command\CreateTenantCommand |
| 89 |
|
*/ |
| 90 |
|
public function testExecuteDisabledTenant() |
| 91 |
|
{ |
| 92 |
|
$this->dialog->setInputStream($this->getInputStream("example\nExample\n")); |
| 93 |
|
$this->command->setContainer($this->getMockContainer(null, 'example')); |
| 94 |
|
$this->commandTester = new CommandTester($this->command); |
| 95 |
|
$this->commandTester->execute(array( |
| 96 |
|
'command' => $this->command->getName(), |
| 97 |
|
'--disabled' => true, |
| 98 |
|
)); |
| 99 |
|
|
| 100 |
|
$this->assertRegExp( |
| 101 |
|
'/Please enter subdomain:Please enter name:Tenant Example has been created and disabled!/', |
| 102 |
|
$this->commandTester->getDisplay() |
| 103 |
|
); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
/** |
| 107 |
|
* @param null $mockTenant |