eZ\Publish\Core\Repository\Tests\Service\Mock\UrlAliasTest::testLoad PHP Method

testLoad() public method

Test for the load() method.
public testLoad ( )
    public function testLoad()
    {
        $mockedService = $this->getPartlyMockedURLAliasServiceService(array('extractPath'));
        /** @var \PHPUnit_Framework_MockObject_MockObject $urlAliasHandlerMock */
        $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler();
        $urlAliasHandlerMock->expects($this->once())->method('loadUrlAlias')->with(42)->will($this->returnValue(new SPIUrlAlias()));
        $mockedService->expects($this->once())->method('extractPath')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias'), null)->will($this->returnValue('path'));
        $urlAlias = $mockedService->load(42);
        self::assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\Content\\URLAlias', $urlAlias);
    }
UrlAliasTest