| Conditions | 1 |
| Paths | 1 |
| Total Lines | 28 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function testExecute() |
||
| 11 | { |
||
| 12 | $application = $this->getApplication(); |
||
| 13 | $application->add(new SymlinksCommand()); |
||
|
|
|||
| 14 | $application->setAutoExit(false); |
||
| 15 | $command = $this->getApplication()->find('dev:symlinks'); |
||
| 16 | |||
| 17 | $commandTester = new CommandTester($command); |
||
| 18 | $commandTester->execute( |
||
| 19 | array( |
||
| 20 | 'command' => $command->getName(), |
||
| 21 | '--global' => true, |
||
| 22 | '--on' => true, |
||
| 23 | ) |
||
| 24 | ); |
||
| 25 | $this->assertRegExp('/Symlinks allowed/', $commandTester->getDisplay()); |
||
| 26 | |||
| 27 | $commandTester = new CommandTester($command); |
||
| 28 | $commandTester->execute( |
||
| 29 | array( |
||
| 30 | 'command' => $command->getName(), |
||
| 31 | '--global' => true, |
||
| 32 | '--off' => true, |
||
| 33 | ) |
||
| 34 | ); |
||
| 35 | |||
| 36 | $this->assertRegExp('/Symlinks denied/', $commandTester->getDisplay()); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: