|
@@ 174-186 (lines=13) @@
|
| 171 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentInfoByRemoteId() |
| 172 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentInfoByRemoteId |
| 173 |
|
*/ |
| 174 |
|
public function testLoadContentInfoByRemoteIdThrowsUnauthorizedException() |
| 175 |
|
{ |
| 176 |
|
/* BEGIN: Use Case */ |
| 177 |
|
$anonymousRemoteId = 'faaeb9be3bd98ed09f606fc16d144eca'; |
| 178 |
|
|
| 179 |
|
$this->setRestrictedEditorUser(); |
| 180 |
|
|
| 181 |
|
$this->expectException(UnauthorizedException::class); |
| 182 |
|
$this->expectExceptionMessageRegExp('/\'read\' \'content\'/'); |
| 183 |
|
|
| 184 |
|
$this->contentService->loadContentInfoByRemoteId($anonymousRemoteId); |
| 185 |
|
/* END: Use Case */ |
| 186 |
|
} |
| 187 |
|
|
| 188 |
|
/** |
| 189 |
|
* Test for the loadVersionInfo() method. |
|
@@ 532-544 (lines=13) @@
|
| 529 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId() |
| 530 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByRemoteId |
| 531 |
|
*/ |
| 532 |
|
public function testLoadContentByRemoteIdThrowsUnauthorizedException() |
| 533 |
|
{ |
| 534 |
|
/* BEGIN: Use Case */ |
| 535 |
|
$anonymousRemoteId = 'faaeb9be3bd98ed09f606fc16d144eca'; |
| 536 |
|
|
| 537 |
|
$this->setRestrictedEditorUser(); |
| 538 |
|
|
| 539 |
|
$this->expectException(UnauthorizedException::class); |
| 540 |
|
$this->expectExceptionMessageRegExp('/\'read\' \'content\'/'); |
| 541 |
|
|
| 542 |
|
$this->contentService->loadContentByRemoteId($anonymousRemoteId); |
| 543 |
|
/* END: Use Case */ |
| 544 |
|
} |
| 545 |
|
|
| 546 |
|
/** |
| 547 |
|
* Test for the loadContentByRemoteId() method. |
|
@@ 552-564 (lines=13) @@
|
| 549 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages) |
| 550 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByRemoteIdWithSecondParameter |
| 551 |
|
*/ |
| 552 |
|
public function testLoadContentByRemoteIdThrowsUnauthorizedExceptionWithSecondParameter() |
| 553 |
|
{ |
| 554 |
|
/* BEGIN: Use Case */ |
| 555 |
|
$anonymousRemoteId = 'faaeb9be3bd98ed09f606fc16d144eca'; |
| 556 |
|
|
| 557 |
|
$this->setRestrictedEditorUser(); |
| 558 |
|
|
| 559 |
|
$this->expectException(UnauthorizedException::class); |
| 560 |
|
$this->expectExceptionMessageRegExp('/\'read\' \'content\'/'); |
| 561 |
|
|
| 562 |
|
$this->contentService->loadContentByRemoteId($anonymousRemoteId, ['eng-US']); |
| 563 |
|
/* END: Use Case */ |
| 564 |
|
} |
| 565 |
|
|
| 566 |
|
/** |
| 567 |
|
* Test for the loadContentByRemoteId() method. |
|
@@ 572-584 (lines=13) @@
|
| 569 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages, $versionNo) |
| 570 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByRemoteIdWithThirdParameter |
| 571 |
|
*/ |
| 572 |
|
public function testLoadContentByRemoteIdThrowsUnauthorizedExceptionWithThirdParameter() |
| 573 |
|
{ |
| 574 |
|
/* BEGIN: Use Case */ |
| 575 |
|
$anonymousRemoteId = 'faaeb9be3bd98ed09f606fc16d144eca'; |
| 576 |
|
|
| 577 |
|
$this->setRestrictedEditorUser(); |
| 578 |
|
|
| 579 |
|
$this->expectException(UnauthorizedException::class); |
| 580 |
|
$this->expectExceptionMessageRegExp('/\'read\' \'content\'/'); |
| 581 |
|
|
| 582 |
|
$this->contentService->loadContentByRemoteId($anonymousRemoteId, ['eng-US'], 2); |
| 583 |
|
/* END: Use Case */ |
| 584 |
|
} |
| 585 |
|
|
| 586 |
|
/** |
| 587 |
|
* Test for the updateContentMetadata() method. |