| @@ 718-738 (lines=21) @@ | ||
| 715 | * |
|
| 716 | * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById() |
|
| 717 | */ |
|
| 718 | public function testLoadVersionInfoById() |
|
| 719 | { |
|
| 720 | $repository = $this->getRepository(); |
|
| 721 | ||
| 722 | $mediaFolderId = $this->generateId('object', 41); |
|
| 723 | /* BEGIN: Use Case */ |
|
| 724 | // $mediaFolderId contains the ID of the "Media" folder |
|
| 725 | ||
| 726 | $contentService = $repository->getContentService(); |
|
| 727 | ||
| 728 | // Load the VersionInfo for "Media" folder |
|
| 729 | $versionInfo = $contentService->loadVersionInfoById($mediaFolderId); |
|
| 730 | /* END: Use Case */ |
|
| 731 | ||
| 732 | $this->assertInstanceOf( |
|
| 733 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\VersionInfo', |
|
| 734 | $versionInfo |
|
| 735 | ); |
|
| 736 | ||
| 737 | return $versionInfo; |
|
| 738 | } |
|
| 739 | ||
| 740 | /** |
|
| 741 | * Test for the returned value of the loadVersionInfoById() method. |
|
| @@ 154-164 (lines=11) @@ | ||
| 151 | * @see \eZ\Publish\API\Repository\ContentService::loadContentInfoList() |
|
| 152 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentInfoList |
|
| 153 | */ |
|
| 154 | public function testLoadContentInfoListSkipsUnauthorizedItems() |
|
| 155 | { |
|
| 156 | $repository = $this->getRepository(); |
|
| 157 | $contentId = $this->generateId('object', 10); |
|
| 158 | $contentService = $repository->getContentService(); |
|
| 159 | $repository->setCurrentUser($this->createAnonymousWithEditorRole()); |
|
| 160 | ||
| 161 | $list = $contentService->loadContentInfoList([$contentId]); |
|
| 162 | ||
| 163 | $this->assertCount(0, $list); |
|
| 164 | } |
|
| 165 | ||
| 166 | /** |
|
| 167 | * Test for the loadContentInfoByRemoteId() method. |
|