public function testCreateCustomUrlAliasIsMiss()
{
$this->loggerMock->expects($this->once())->method('logCall');
$urlAlias = new UrlAlias(array('id' => 55, 'destination' => 44));
$innerHandler = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias\\Handler');
$this->persistenceHandlerMock->expects($this->once())->method('urlAliasHandler')->will($this->returnValue($innerHandler));
$innerHandler->expects($this->once())->method('createCustomUrlAlias')->with(44, '/path', true, 'eng-GB', true)->will($this->returnValue($urlAlias));
$cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
$this->cacheMock->expects($this->at(0))->method('getItem')->with('urlAlias', 55)->will($this->returnValue($cacheItemMock));
$cacheItemMock->expects($this->never())->method('get');
$cacheItemMock->expects($this->once())->method('set')->with($urlAlias)->will($this->returnValue($cacheItemMock));
$cacheItemMock->expects($this->once())->method('save')->with();
$cacheItemMock2 = $this->getMock('Stash\\Interfaces\\ItemInterface');
$this->cacheMock->expects($this->at(1))->method('getItem')->with('urlAlias', 'location', 44, 'custom')->will($this->returnValue($cacheItemMock2));
$cacheItemMock2->expects($this->once())->method('get')->will($this->returnValue(null));
$cacheItemMock2->expects($this->once())->method('isMiss')->will($this->returnValue(true));
$cacheItemMock2->expects($this->once())->method('set')->with(array(55))->will($this->returnValue($cacheItemMock2));
$cacheItemMock2->expects($this->once())->method('save')->with();
$handler = $this->persistenceCacheHandler->urlAliasHandler();
$handler->createCustomUrlAlias(44, '/path', true, 'eng-GB', true);
}