| @@ 2519-2538 (lines=20) @@ | ||
| 2516 | /** |
|
| 2517 | * Test for the listGlobalAliases() method. |
|
| 2518 | */ |
|
| 2519 | public function testListGlobalAliasesWithParameters() |
|
| 2520 | { |
|
| 2521 | $urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
|
| 2522 | ||
| 2523 | $this->urlAliasHandler->expects( |
|
| 2524 | $this->once() |
|
| 2525 | )->method( |
|
| 2526 | 'listGlobalURLAliases' |
|
| 2527 | )->with( |
|
| 2528 | $this->equalTo('languageCode'), |
|
| 2529 | $this->equalTo('offset'), |
|
| 2530 | $this->equalTo('limit') |
|
| 2531 | )->will( |
|
| 2532 | $this->returnValue([]) |
|
| 2533 | ); |
|
| 2534 | ||
| 2535 | $urlAliases = $urlAliasService->listGlobalAliases('languageCode', 'offset', 'limit'); |
|
| 2536 | ||
| 2537 | self::assertEmpty($urlAliases); |
|
| 2538 | } |
|
| 2539 | ||
| 2540 | /** |
|
| 2541 | * Test for the lookup() method. |
|
| @@ 3390-3409 (lines=20) @@ | ||
| 3387 | * @covers \eZ\Publish\Core\Repository\URLAliasService::createUrlAlias |
|
| 3388 | * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
|
| 3389 | */ |
|
| 3390 | public function testCreateUrlAliasThrowsUnauthorizedException() |
|
| 3391 | { |
|
| 3392 | $mockedService = $this->getPartlyMockedURLAliasServiceService(); |
|
| 3393 | $location = $this->getLocationStub(); |
|
| 3394 | $this->permissionResolver |
|
| 3395 | ->expects($this->once()) |
|
| 3396 | ->method('canUser')->with( |
|
| 3397 | $this->equalTo('content'), |
|
| 3398 | $this->equalTo('urltranslator'), |
|
| 3399 | $this->equalTo($location) |
|
| 3400 | ) |
|
| 3401 | ->will($this->returnValue(false)); |
|
| 3402 | ||
| 3403 | $mockedService->createUrlAlias( |
|
| 3404 | $location, |
|
| 3405 | 'path', |
|
| 3406 | 'languageCode', |
|
| 3407 | 'forwarding' |
|
| 3408 | ); |
|
| 3409 | } |
|
| 3410 | ||
| 3411 | /** |
|
| 3412 | * Test for the createGlobalUrlAlias() method. |
|