| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function willHandlePlaceRobot() |
||
| 24 | { |
||
| 25 | $mockRepo = self::createMock(RobotRepositoryInterface::class); |
||
| 26 | $mockLogger = self::createMock(LoggerInterface::class); |
||
| 27 | $robotReporter = new RobotReporter($mockRepo, $mockLogger); |
||
| 28 | |||
| 29 | self::assertInstanceOf(RobotReporter::class, $robotReporter); |
||
| 30 | |||
| 31 | $query = new RobotReport(); |
||
| 32 | |||
| 33 | $robot = Table::create(3)->placeRobot(); |
||
| 34 | |||
| 35 | $mockRepo->expects($this->once()) |
||
| 36 | ->method('load') |
||
| 37 | ->willReturn($robot); |
||
| 38 | |||
| 39 | $result = $robotReporter->handleReport($query); |
||
| 40 | |||
| 41 | self::assertSame('0,0,E', $result); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: