public function testCreateUrlAliasWithRollback()
{
$repositoryMock = $this->getRepositoryMock();
$mockedService = $this->getPartlyMockedURLAliasServiceService();
/** @var \PHPUnit_Framework_MockObject_MockObject $urlAliasHandlerMock */
$urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler();
$location = $this->getLocationStub();
$repositoryMock->expects($this->once())->method('beginTransaction');
$repositoryMock->expects($this->once())->method('rollback');
$urlAliasHandlerMock->expects($this->once())->method('createCustomUrlAlias')->with($this->equalTo($location->id), $this->equalTo('path'), $this->equalTo('forwarding'), $this->equalTo('languageCode'), $this->equalTo('alwaysAvailable'))->will($this->throwException(new Exception('Handler threw an exception')));
$mockedService->createUrlAlias($location, 'path', 'languageCode', 'forwarding', 'alwaysAvailable');
}