|
@@ 174-189 (lines=16) @@
|
| 171 |
|
/** |
| 172 |
|
* Test for the removeAliases() method. |
| 173 |
|
*/ |
| 174 |
|
public function testRemoveAliasesThrowsInvalidArgumentException() |
| 175 |
|
{ |
| 176 |
|
$aliasList = [new URLAlias(['isCustom' => false])]; |
| 177 |
|
$mockedService = $this->getPartlyMockedURLAliasServiceService(); |
| 178 |
|
$this->permissionResolver |
| 179 |
|
->expects($this->once()) |
| 180 |
|
->method('hasAccess')->with( |
| 181 |
|
$this->equalTo('content'), |
| 182 |
|
$this->equalTo('urltranslator') |
| 183 |
|
) |
| 184 |
|
->will($this->returnValue(true)); |
| 185 |
|
|
| 186 |
|
$this->expectException(InvalidArgumentException::class); |
| 187 |
|
|
| 188 |
|
$mockedService->removeAliases($aliasList); |
| 189 |
|
} |
| 190 |
|
|
| 191 |
|
/** |
| 192 |
|
* Test for the removeAliases() method. |
|
@@ 3443-3456 (lines=14) @@
|
| 3440 |
|
* @covers \eZ\Publish\Core\Repository\URLAliasService::removeAliases |
| 3441 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
| 3442 |
|
*/ |
| 3443 |
|
public function testRemoveAliasesThrowsUnauthorizedException() |
| 3444 |
|
{ |
| 3445 |
|
$aliasList = [new URLAlias(['isCustom' => true])]; |
| 3446 |
|
$mockedService = $this->getPartlyMockedURLAliasServiceService(); |
| 3447 |
|
$this->permissionResolver |
| 3448 |
|
->expects($this->once()) |
| 3449 |
|
->method('hasAccess')->with( |
| 3450 |
|
$this->equalTo('content'), |
| 3451 |
|
$this->equalTo('urltranslator') |
| 3452 |
|
) |
| 3453 |
|
->will($this->returnValue(false)); |
| 3454 |
|
|
| 3455 |
|
$mockedService->removeAliases($aliasList); |
| 3456 |
|
} |
| 3457 |
|
|
| 3458 |
|
/** |
| 3459 |
|
* @return \PHPUnit_Framework_MockObject_MockObject|\eZ\Publish\Core\Repository\Helper\NameSchemaService |