| @@ 140-154 (lines=15) @@ | ||
| 137 | * |
|
| 138 | * @return \eZ\Publish\API\Repository\Values\Content\Content |
|
| 139 | */ |
|
| 140 | protected function createContentDraftVersion2() |
|
| 141 | { |
|
| 142 | $repository = $this->getRepository(); |
|
| 143 | ||
| 144 | $contentService = $repository->getContentService(); |
|
| 145 | ||
| 146 | /* BEGIN: Inline */ |
|
| 147 | $content = $this->createContentVersion1(); |
|
| 148 | ||
| 149 | // Create a new draft from the published content |
|
| 150 | $draftVersion2 = $contentService->createContentDraft($content->contentInfo); |
|
| 151 | /* END: Inline */ |
|
| 152 | ||
| 153 | return $draftVersion2; |
|
| 154 | } |
|
| 155 | ||
| 156 | /** |
|
| 157 | * Creates an updated content draft named <b>$draftVersion2</b> from |
|
| @@ 2431-2444 (lines=14) @@ | ||
| 2428 | * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
|
| 2429 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter |
|
| 2430 | */ |
|
| 2431 | public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter() |
|
| 2432 | { |
|
| 2433 | $repository = $this->getRepository(); |
|
| 2434 | ||
| 2435 | $contentService = $repository->getContentService(); |
|
| 2436 | ||
| 2437 | /* BEGIN: Use Case */ |
|
| 2438 | $content = $this->createContentVersion1(); |
|
| 2439 | ||
| 2440 | // This call will fail with a "NotFoundException", because no content |
|
| 2441 | // with versionNo = 2 exists. |
|
| 2442 | $contentService->loadContentByContentInfo($content->contentInfo, null, 2); |
|
| 2443 | /* END: Use Case */ |
|
| 2444 | } |
|
| 2445 | ||
| 2446 | /** |
|
| 2447 | * Test for the loadContent() method. |
|