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

testCreateGlobalUrlAlias() public method

    public function testCreateGlobalUrlAlias()
    {
        $this->loggerMock->expects($this->once())->method('logCall');
        $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('createGlobalUrlAlias')->with('/old', '/path', true, 'eng-GB', true)->will($this->returnValue(new UrlAlias(array('id' => 55))));
        $cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
        $this->cacheMock->expects($this->once())->method('getItem')->with('urlAlias', 55)->will($this->returnValue($cacheItemMock));
        $cacheItemMock->expects($this->once())->method('set')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias'))->will($this->returnValue($cacheItemMock));
        $cacheItemMock->expects($this->once())->method('save')->with();
        $cacheItemMock->expects($this->never())->method('get');
        $handler = $this->persistenceCacheHandler->urlAliasHandler();
        $handler->createGlobalUrlAlias('/old', '/path', true, 'eng-GB', true);
    }