| @@ 148-162 (lines=15) @@ | ||
| 145 | * |
|
| 146 | * @return \eZ\Publish\API\Repository\Values\Content\Content |
|
| 147 | */ |
|
| 148 | protected function createContentDraftVersion2() |
|
| 149 | { |
|
| 150 | $repository = $this->getRepository(); |
|
| 151 | ||
| 152 | $contentService = $repository->getContentService(); |
|
| 153 | ||
| 154 | /* BEGIN: Inline */ |
|
| 155 | $content = $this->createContentVersion1(); |
|
| 156 | ||
| 157 | // Create a new draft from the published content |
|
| 158 | $draftVersion2 = $contentService->createContentDraft($content->contentInfo); |
|
| 159 | /* END: Inline */ |
|
| 160 | ||
| 161 | return $draftVersion2; |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * Creates an updated content draft named <b>$draftVersion2</b> from |
|
| @@ 2877-2890 (lines=14) @@ | ||
| 2874 | * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
|
| 2875 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter |
|
| 2876 | */ |
|
| 2877 | public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter() |
|
| 2878 | { |
|
| 2879 | $repository = $this->getRepository(); |
|
| 2880 | ||
| 2881 | $contentService = $repository->getContentService(); |
|
| 2882 | ||
| 2883 | /* BEGIN: Use Case */ |
|
| 2884 | $content = $this->createContentVersion1(); |
|
| 2885 | ||
| 2886 | // This call will fail with a "NotFoundException", because no content |
|
| 2887 | // with versionNo = 2 exists. |
|
| 2888 | $contentService->loadContentByContentInfo($content->contentInfo, null, 2); |
|
| 2889 | /* END: Use Case */ |
|
| 2890 | } |
|
| 2891 | ||
| 2892 | /** |
|
| 2893 | * Test for the loadContent() method. |
|