Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function testPipelineIsInvokedWithTheNecessaryOptions() |
||
32 | { |
||
33 | $input = new StringInput('-t abc'); |
||
34 | $output = new DummyOutput(); |
||
35 | |||
36 | $pipeline = m::mock(PipelineInterface::class); |
||
37 | $pipeline |
||
|
|||
38 | ->shouldReceive('__invoke') |
||
39 | ->withArgs(function(array $options){ |
||
40 | return $options['target'] === 'abc'; |
||
41 | }) |
||
42 | ->once(); |
||
43 | |||
44 | $command = new TransformCommand($pipeline); |
||
45 | |||
46 | $this->assertSame(0, $command->run($input, $output)); |
||
47 | } |
||
48 | } |
||
49 |
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: