Code Duplication    Length = 14-15 lines in 2 locations

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

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

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

@@ 2364-2377 (lines=14) @@
2361
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2362
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter
2363
     */
2364
    public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter()
2365
    {
2366
        $repository = $this->getRepository();
2367
2368
        $contentService = $repository->getContentService();
2369
2370
        /* BEGIN: Use Case */
2371
        $content = $this->createContentVersion1();
2372
2373
        // This call will fail with a "NotFoundException", because no content
2374
        // with versionNo = 2 exists.
2375
        $contentService->loadContentByContentInfo($content->contentInfo, null, 2);
2376
        /* END: Use Case */
2377
    }
2378
2379
    /**
2380
     * Test for the loadContent() method.