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

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