| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function testExecute() |
||
| 11 | { |
||
| 12 | $application = $this->getApplication(); |
||
| 13 | $config = $application->getConfig(); |
||
|
|
|||
| 14 | $config['script']['folders'][] = __DIR__ . '/_scripts'; |
||
| 15 | $application->setConfig($config); |
||
| 16 | |||
| 17 | $application->add(new RunCommand()); |
||
| 18 | $command = $this->getApplication()->find('script:repo:list'); |
||
| 19 | |||
| 20 | $commandTester = new CommandTester($command); |
||
| 21 | $commandTester->execute( |
||
| 22 | array( |
||
| 23 | 'command' => $command->getName(), |
||
| 24 | ) |
||
| 25 | ); |
||
| 26 | |||
| 27 | $this->assertContains('Cache Flush Command Test (Hello World)', $commandTester->getDisplay()); |
||
| 28 | $this->assertContains('Foo command', $commandTester->getDisplay()); |
||
| 29 | $this->assertContains('Bar command', $commandTester->getDisplay()); |
||
| 30 | } |
||
| 31 | } |
||
| 32 |
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: