Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function testTrait() |
||
20 | { |
||
21 | /* @var \PHPUnit_Framework_MockObject_MockObject|LimitTrait $mock */ |
||
22 | $mock = $this->getMockForTrait('\Jalle19\StatusManager\Database\LimitTrait'); |
||
23 | |||
24 | $mock->expects($this->once()) |
||
|
|||
25 | ->method('limit'); |
||
26 | |||
27 | $mock->filterByLimit(10); |
||
28 | |||
29 | $mock->expects($this->never()) |
||
30 | ->method('limit'); |
||
31 | |||
32 | $mock->filterByLimit(null); |
||
33 | } |
||
34 | |||
36 |
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: