Code Duplication    Length = 14-15 lines in 2 locations

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

@@ 140-154 (lines=15) @@
137
     *
138
     * @return \eZ\Publish\API\Repository\Values\Content\Content
139
     */
140
    protected function createContentDraftVersion2()
141
    {
142
        $repository = $this->getRepository();
143
144
        $contentService = $repository->getContentService();
145
146
        /* BEGIN: Inline */
147
        $content = $this->createContentVersion1();
148
149
        // Create a new draft from the published content
150
        $draftVersion2 = $contentService->createContentDraft($content->contentInfo);
151
        /* END: Inline */
152
153
        return $draftVersion2;
154
    }
155
156
    /**
157
     * Creates an updated content draft named <b>$draftVersion2</b> from

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

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