| @@ 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 |
|
| @@ 2485-2498 (lines=14) @@ | ||
| 2482 | * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
|
| 2483 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter |
|
| 2484 | */ |
|
| 2485 | public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter() |
|
| 2486 | { |
|
| 2487 | $repository = $this->getRepository(); |
|
| 2488 | ||
| 2489 | $contentService = $repository->getContentService(); |
|
| 2490 | ||
| 2491 | /* BEGIN: Use Case */ |
|
| 2492 | $content = $this->createContentVersion1(); |
|
| 2493 | ||
| 2494 | // This call will fail with a "NotFoundException", because no content |
|
| 2495 | // with versionNo = 2 exists. |
|
| 2496 | $contentService->loadContentByContentInfo($content->contentInfo, null, 2); |
|
| 2497 | /* END: Use Case */ |
|
| 2498 | } |
|
| 2499 | ||
| 2500 | /** |
|
| 2501 | * Test for the loadContent() method. |
|