eZ\Publish\Core\Repository\Tests\Service\Mock\UrlAliasTest::testCreateGlobalUrlAliasWithRollback PHP 메소드

testCreateGlobalUrlAliasWithRollback() 공개 메소드

Test for the createGlobalUrlAlias() method.
    public function testCreateGlobalUrlAliasWithRollback()
    {
        $resource = 'module:content/search';
        $repositoryMock = $this->getRepositoryMock();
        $mockedService = $this->getPartlyMockedURLAliasServiceService();
        /** @var \PHPUnit_Framework_MockObject_MockObject $urlAliasHandlerMock */
        $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler();
        $repositoryMock->expects($this->once())->method('beginTransaction');
        $repositoryMock->expects($this->once())->method('rollback');
        $urlAliasHandlerMock->expects($this->once())->method('createGlobalUrlAlias')->with($this->equalTo($resource), $this->equalTo('path'), $this->equalTo('forwarding'), $this->equalTo('languageCode'), $this->equalTo('alwaysAvailable'))->will($this->throwException(new Exception('Handler threw an exception')));
        $mockedService->createGlobalUrlAlias($resource, 'path', 'languageCode', 'forwarding', 'alwaysAvailable');
    }
UrlAliasTest