| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function testExecute() |
||
| 12 | { |
||
| 13 | $application = $this->getApplication(); |
||
| 14 | $application->add(new ListCommand()); |
||
|
|
|||
| 15 | $command = $this->getApplication()->find('sys:url:list'); |
||
| 16 | |||
| 17 | $commandTester = new CommandTester($command); |
||
| 18 | $commandTester->execute( |
||
| 19 | array( |
||
| 20 | 'command' => $command->getName(), |
||
| 21 | 'stores' => 0, // admin store |
||
| 22 | 'linetemplate' => 'prefix {url} suffix', |
||
| 23 | '--add-categories' => true, |
||
| 24 | '--add-products' => true, |
||
| 25 | '--add-cmspages' => true, |
||
| 26 | ) |
||
| 27 | ); |
||
| 28 | |||
| 29 | $this->assertRegExp('/prefix/', $commandTester->getDisplay()); |
||
| 30 | $this->assertRegExp('/http/', $commandTester->getDisplay()); |
||
| 31 | $this->assertRegExp('/suffix/', $commandTester->getDisplay()); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
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: