Code Duplication    Length = 14-15 lines in 2 locations

eZ/Publish/API/Repository/Tests/BaseContentServiceTest.php 1 location

@@ 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

eZ/Publish/API/Repository/Tests/ContentServiceTest.php 1 location

@@ 2884-2897 (lines=14) @@
2881
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2882
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter
2883
     */
2884
    public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter()
2885
    {
2886
        $repository = $this->getRepository();
2887
2888
        $contentService = $repository->getContentService();
2889
2890
        /* BEGIN: Use Case */
2891
        $content = $this->createContentVersion1();
2892
2893
        // This call will fail with a "NotFoundException", because no content
2894
        // with versionNo = 2 exists.
2895
        $contentService->loadContentByContentInfo($content->contentInfo, null, 2);
2896
        /* END: Use Case */
2897
    }
2898
2899
    /**
2900
     * Test for the loadContent() method.