public function testLookupHasHistoryCache() { $urlAlias = new UrlAlias(array('id' => 55)); $this->loggerMock->expects($this->never())->method('logCall'); $missedUrlAliasIdCacheItem = $this->getMock('Stash\\Interfaces\\ItemInterface'); $missedUrlAliasIdCacheItem->expects($this->once())->method('get')->will($this->returnValue(null)); $missedUrlAliasIdCacheItem->expects($this->once())->method('isMiss')->will($this->returnValue(true)); $historyUrlAliasCacheItem = $this->getMock('Stash\\Interfaces\\ItemInterface'); $historyUrlAliasCacheItem->expects($this->once())->method('get')->will($this->returnValue($urlAlias)); $historyUrlAliasCacheItem->expects($this->once())->method('isMiss')->will($this->returnValue(false)); $this->cacheMock->expects($this->at(0))->method('getItem')->with('urlAlias', 'url', '/url')->will($this->returnValue($missedUrlAliasIdCacheItem)); $this->cacheMock->expects($this->at(1))->method('getItem')->with('urlAlias', 'url', 'history', '/url')->will($this->returnValue($historyUrlAliasCacheItem)); $this->persistenceHandlerMock->expects($this->never())->method('urlAliasHandler'); $handler = $this->persistenceCacheHandler->urlAliasHandler(); $handler->lookup('/url'); }