| @@ 139-153 (lines=15) @@ | ||
| 136 | * |
|
| 137 | * @return \eZ\Publish\API\Repository\Values\Content\Content |
|
| 138 | */ |
|
| 139 | protected function createContentDraftVersion2() |
|
| 140 | { |
|
| 141 | $repository = $this->getRepository(); |
|
| 142 | ||
| 143 | $contentService = $repository->getContentService(); |
|
| 144 | ||
| 145 | /* BEGIN: Inline */ |
|
| 146 | $content = $this->createContentVersion1(); |
|
| 147 | ||
| 148 | // Create a new draft from the published content |
|
| 149 | $draftVersion2 = $contentService->createContentDraft($content->contentInfo); |
|
| 150 | /* END: Inline */ |
|
| 151 | ||
| 152 | return $draftVersion2; |
|
| 153 | } |
|
| 154 | ||
| 155 | /** |
|
| 156 | * Creates an updated content draft named <b>$draftVersion2</b> from |
|
| @@ 2731-2744 (lines=14) @@ | ||
| 2728 | * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
|
| 2729 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter |
|
| 2730 | */ |
|
| 2731 | public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter() |
|
| 2732 | { |
|
| 2733 | $repository = $this->getRepository(); |
|
| 2734 | ||
| 2735 | $contentService = $repository->getContentService(); |
|
| 2736 | ||
| 2737 | /* BEGIN: Use Case */ |
|
| 2738 | $content = $this->createContentVersion1(); |
|
| 2739 | ||
| 2740 | // This call will fail with a "NotFoundException", because no content |
|
| 2741 | // with versionNo = 2 exists. |
|
| 2742 | $contentService->loadContentByContentInfo($content->contentInfo, null, 2); |
|
| 2743 | /* END: Use Case */ |
|
| 2744 | } |
|
| 2745 | ||
| 2746 | /** |
|
| 2747 | * Test for the loadContent() method. |
|