eZ\Publish\Core\Persistence\Cache\Tests\UrlAliasHandlerTest::testPublishUrlAliasForLocationWithoutCachedLocation PHP Method

testPublishUrlAliasForLocationWithoutCachedLocation() public method

    public function testPublishUrlAliasForLocationWithoutCachedLocation()
    {
        $this->loggerMock->expects($this->once())->method('logCall');
        $innerHandler = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias\\Handler');
        $cacheItem = $this->getMock('Stash\\Interfaces\\ItemInterface');
        $this->persistenceHandlerMock->expects($this->once())->method('urlAliasHandler')->will($this->returnValue($innerHandler));
        $innerHandler->expects($this->once())->method('publishUrlAliasForLocation')->with(44, 2, 'name', 'eng-GB', true)->will($this->returnValue(new UrlAlias(array('id' => 55))));
        $cacheItem->expects($this->once())->method('isMiss')->willReturn(true);
        $cacheItem->expects($this->never())->method('clear');
        $this->cacheMock->expects($this->once())->method('clear')->with('urlAlias')->will($this->returnValue(null));
        $this->cacheMock->expects($this->once())->method('getItem')->with('urlAlias', 'location', 44)->willReturn($cacheItem);
        $handler = $this->persistenceCacheHandler->urlAliasHandler();
        $handler->publishUrlAliasForLocation(44, 2, 'name', 'eng-GB', true);
    }