| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function testInvoke() |
||
| 12 | { |
||
| 13 | $filePath = '/path/to/font'; |
||
| 14 | $resourceExpected = 'resource'; |
||
| 15 | $bmp = m::mock(Bmp::class) |
||
| 16 | ->shouldReceive('createFromFile') |
||
|
|
|||
| 17 | ->with($filePath) |
||
| 18 | ->andReturn($resourceExpected) |
||
| 19 | ->once() |
||
| 20 | ->getMock(); |
||
| 21 | |||
| 22 | $graphicResolver = new GraphicResolverFilePath($bmp); |
||
| 23 | $resourceActual = $graphicResolver($filePath); |
||
| 24 | |||
| 25 | $this->assertEquals($resourceExpected, $resourceActual); |
||
| 26 | } |
||
| 28 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.