| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class FlushCacheTest extends TestCase |
||
| 13 | { |
||
| 14 | /** @var FlushCache - System Under Test */ |
||
| 15 | protected FlushCache $sut; |
||
| 16 | |||
| 17 | /** @var ICacheManager|MockObject */ |
||
| 18 | protected $cacheManagerMock; |
||
| 19 | |||
| 20 | public function setUp(): void |
||
| 21 | { |
||
| 22 | $this->cacheManagerMock = $this->getMockBuilder(ICacheManager::class)->getMock(); |
||
| 23 | |||
| 24 | $this->sut = new FlushCache($this->cacheManagerMock); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function testExecuteFlushesCache(): void |
||
| 28 | { |
||
| 29 | $responseMock = $this->getMockBuilder(IResponse::class) |
||
| 30 | ->disableOriginalConstructor() |
||
| 31 | ->getMock(); |
||
| 32 | |||
| 33 | $this->cacheManagerMock->expects($this->atLeastOnce())->method('flush'); |
||
| 34 | $responseMock->expects($this->atLeastOnce())->method('writeln'); |
||
| 35 | |||
| 36 | $this->sut->execute($responseMock); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function testExecutesWritesResponseOnExceptions(): void |
||
| 52 | } |
||
| 53 | } |
||
| 54 |