| @@ 3186-3204 (lines=19) @@ | ||
| 3183 | * |
|
| 3184 | * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 3185 | */ |
|
| 3186 | public function testCreateGlobalUrlAliasThrowsInvalidArgumentExceptionResource() |
|
| 3187 | { |
|
| 3188 | $mockedService = $this->getPartlyMockedURLAliasServiceService(); |
|
| 3189 | $this->permissionResolver |
|
| 3190 | ->expects($this->once()) |
|
| 3191 | ->method('hasAccess')->with( |
|
| 3192 | $this->equalTo('content'), |
|
| 3193 | $this->equalTo('urltranslator') |
|
| 3194 | ) |
|
| 3195 | ->will($this->returnValue(true)); |
|
| 3196 | ||
| 3197 | $mockedService->createGlobalUrlAlias( |
|
| 3198 | 'invalid/resource', |
|
| 3199 | 'path', |
|
| 3200 | 'languageCode', |
|
| 3201 | 'forwarding', |
|
| 3202 | 'alwaysAvailable' |
|
| 3203 | ); |
|
| 3204 | } |
|
| 3205 | ||
| 3206 | /** |
|
| 3207 | * Test for the createGlobalUrlAlias() method. |
|
| @@ 3417-3435 (lines=19) @@ | ||
| 3414 | * @covers \eZ\Publish\Core\Repository\URLAliasService::createGlobalUrlAlias |
|
| 3415 | * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
|
| 3416 | */ |
|
| 3417 | public function testCreateGlobalUrlAliasThrowsUnauthorizedException() |
|
| 3418 | { |
|
| 3419 | $mockedService = $this->getPartlyMockedURLAliasServiceService(); |
|
| 3420 | $this->permissionResolver |
|
| 3421 | ->expects($this->once()) |
|
| 3422 | ->method('hasAccess')->with( |
|
| 3423 | $this->equalTo('content'), |
|
| 3424 | $this->equalTo('urltranslator') |
|
| 3425 | ) |
|
| 3426 | ->will($this->returnValue(false)); |
|
| 3427 | ||
| 3428 | $mockedService->createGlobalUrlAlias( |
|
| 3429 | 'eznode:42', |
|
| 3430 | 'path', |
|
| 3431 | 'languageCode', |
|
| 3432 | 'forwarding', |
|
| 3433 | 'alwaysAvailable' |
|
| 3434 | ); |
|
| 3435 | } |
|
| 3436 | ||
| 3437 | /** |
|
| 3438 | * Test for the removeAliases() method. |
|