Code Duplication    Length = 14-15 lines in 2 locations

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

@@ 2788-2801 (lines=14) @@
2785
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2786
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter
2787
     */
2788
    public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter()
2789
    {
2790
        $repository = $this->getRepository();
2791
2792
        $contentService = $repository->getContentService();
2793
2794
        /* BEGIN: Use Case */
2795
        $content = $this->createContentVersion1();
2796
2797
        // This call will fail with a "NotFoundException", because no content
2798
        // with versionNo = 2 exists.
2799
        $contentService->loadContentByContentInfo($content->contentInfo, null, 2);
2800
        /* END: Use Case */
2801
    }
2802
2803
    /**
2804
     * Test for the loadContent() method.

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