Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function testExecute() |
||
15 | { |
||
16 | $command = $this->getApplication()->find('admin:token:create'); |
||
|
|||
17 | |||
18 | $commandTester = new CommandTester($command); |
||
19 | $commandTester->execute([ |
||
20 | 'username' => 'admin', |
||
21 | '--no-newline' => true, |
||
22 | ]); |
||
23 | |||
24 | $output = $commandTester->getDisplay(); |
||
25 | $this->assertNotEmpty($output); |
||
26 | $this->assertEquals(32, strlen($output)); |
||
27 | } |
||
28 | } |
||
29 |
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: