| Total Complexity | 3 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class FlushCacheTest extends TestCase |
||
| 12 | { |
||
| 13 | private FlushCache $sut; |
||
| 14 | |||
| 15 | public function setUp(): void |
||
| 18 | } |
||
| 19 | |||
| 20 | public function testDoExecuteCallsAllSubCommands() |
||
| 21 | { |
||
| 22 | $responseMock = $this |
||
| 23 | ->getMockBuilder(IResponse::class) |
||
| 24 | ->disableOriginalConstructor() |
||
| 25 | ->getMock(); |
||
| 26 | $commandCollectionMock = $this->getMockBuilder(CommandCollection::class) |
||
| 27 | ->disableOriginalConstructor() |
||
| 28 | ->getMock(); |
||
| 29 | |||
| 30 | $commandCollectionMock->expects($this->exactly(4))->method('call'); |
||
| 31 | |||
| 32 | $this->sut->setCommandCollection($commandCollectionMock); |
||
| 33 | $result = $this->sut->execute($responseMock); |
||
|
|
|||
| 34 | |||
| 35 | $this->assertNull($result); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function testDoExecuteWritesErrorMessageOnException() |
||
| 58 | } |
||
| 59 | } |
||
| 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.