| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function testExecute() |
||
| 12 | { |
||
| 13 | $application = $this->getApplication(); |
||
| 14 | if ($application->getMagentoMajorVersion() == Application::MAGENTO_MAJOR_VERSION_1) { |
||
|
|
|||
| 15 | $application = $this->getApplication(); |
||
| 16 | $application->add(new FlushCommand()); |
||
| 17 | $command = $this->getApplication()->find('cache:flush'); |
||
| 18 | |||
| 19 | $commandTester = new CommandTester($command); |
||
| 20 | $commandTester->execute(array('command' => $command->getName())); |
||
| 21 | |||
| 22 | $this->assertRegExp('/cache flushed/', $commandTester->getDisplay()); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | } |
||
| 26 |
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: