| @@ 138-152 (lines=15) @@ | ||
| 135 | * |
|
| 136 | * @return \eZ\Publish\API\Repository\Values\Content\Content |
|
| 137 | */ |
|
| 138 | protected function createContentDraftVersion2() |
|
| 139 | { |
|
| 140 | $repository = $this->getRepository(); |
|
| 141 | ||
| 142 | $contentService = $repository->getContentService(); |
|
| 143 | ||
| 144 | /* BEGIN: Inline */ |
|
| 145 | $content = $this->createContentVersion1(); |
|
| 146 | ||
| 147 | // Create a new draft from the published content |
|
| 148 | $draftVersion2 = $contentService->createContentDraft($content->contentInfo); |
|
| 149 | /* END: Inline */ |
|
| 150 | ||
| 151 | return $draftVersion2; |
|
| 152 | } |
|
| 153 | ||
| 154 | /** |
|
| 155 | * Creates an updated content draft named <b>$draftVersion2</b> from |
|
| @@ 2693-2706 (lines=14) @@ | ||
| 2690 | * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
|
| 2691 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter |
|
| 2692 | */ |
|
| 2693 | public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter() |
|
| 2694 | { |
|
| 2695 | $repository = $this->getRepository(); |
|
| 2696 | ||
| 2697 | $contentService = $repository->getContentService(); |
|
| 2698 | ||
| 2699 | /* BEGIN: Use Case */ |
|
| 2700 | $content = $this->createContentVersion1(); |
|
| 2701 | ||
| 2702 | // This call will fail with a "NotFoundException", because no content |
|
| 2703 | // with versionNo = 2 exists. |
|
| 2704 | $contentService->loadContentByContentInfo($content->contentInfo, null, 2); |
|
| 2705 | /* END: Use Case */ |
|
| 2706 | } |
|
| 2707 | ||
| 2708 | /** |
|
| 2709 | * Test for the loadContent() method. |
|