/** * @test */ public function clearsCachesOfDuplicateRegisteredPageIdsOnlyOnce() { $this->cacheManagerMock->expects($this->at(0))->method('flushCachesInGroupByTag')->with('pages', 'pageId_2'); $this->cacheManagerMock->expects($this->at(1))->method('flushCachesInGroupByTag')->with('pages', 'pageId_15'); $this->cacheManagerMock->expects($this->at(2))->method('flushCachesInGroupByTag')->with('pages', 'pageId_8'); $this->cacheManagerMock->expects($this->exactly(3))->method('flushCachesInGroupByTag'); $this->cacheService->getPageIdStack()->push(8); $this->cacheService->getPageIdStack()->push(15); $this->cacheService->getPageIdStack()->push(15); $this->cacheService->getPageIdStack()->push(2); $this->cacheService->getPageIdStack()->push(2); $this->cacheService->clearCachesOfRegisteredPageIds(); }