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