| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function testDoExecuteWritesErrorMessageOnException() |
||
| 39 | { |
||
| 40 | $ex = new \Exception(); |
||
| 41 | |||
| 42 | $responseMock = $this |
||
| 43 | ->getMockBuilder(IResponse::class) |
||
| 44 | ->disableOriginalConstructor() |
||
| 45 | ->getMock(); |
||
| 46 | $commandCollectionMock = $this->getMockBuilder(CommandCollection::class) |
||
| 47 | ->disableOriginalConstructor() |
||
| 48 | ->getMock(); |
||
| 49 | |||
| 50 | $responseMock->expects($this->exactly(8))->method('writeln'); |
||
| 51 | |||
| 52 | $commandCollectionMock->expects($this->exactly(4))->method('call')->willThrowException($ex); |
||
| 53 | |||
| 54 | $this->sut->setCommandCollection($commandCollectionMock); |
||
| 55 | $result = $this->sut->execute($responseMock); |
||
| 56 | |||
| 57 | $this->assertNull($result); |
||
| 58 | } |
||
| 60 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.