Code Duplication    Length = 20-21 lines in 2 locations

eZ/Publish/API/Repository/Tests/ContentServiceTest.php 2 locations

@@ 1268-1288 (lines=21) @@
1265
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion
1266
     * @group user
1267
     */
1268
    public function testCreateContentDraftAndLoadAccess()
1269
    {
1270
        $repository = $this->getRepository();
1271
1272
        /* BEGIN: Use Case */
1273
        $user = $this->createUserVersion1();
1274
1275
        // Set new editor as user
1276
        $repository->setCurrentUser($user);
1277
1278
        // Create draft
1279
        $draft = $this->createContentDraftVersion1(2, 'folder');
1280
1281
        // Try to load the draft
1282
        $contentService = $repository->getContentService();
1283
        $loadedDraft = $contentService->loadContent($draft->id);
1284
1285
        /* END: Use Case */
1286
1287
        $this->assertEquals($draft->id, $loadedDraft->id);
1288
    }
1289
1290
    /**
1291
     * Test for the createContentDraft() method.
@@ 1886-1905 (lines=20) @@
1883
     *
1884
     * @covers \eZ\Publish\Core\Repository\ContentService::createContentDraft
1885
     */
1886
    public function testCreateContentDraftWithThirdParameter()
1887
    {
1888
        $repository = $this->getRepository();
1889
1890
        $contentService = $repository->getContentService();
1891
1892
        $content = $contentService->loadContent(4);
1893
        $user = $this->createUserVersion1();
1894
1895
        $draftContent = $contentService->createContentDraft(
1896
            $content->contentInfo,
1897
            $content->getVersionInfo(),
1898
            $user
1899
        );
1900
1901
        $this->assertInstanceOf(
1902
            Content::class,
1903
            $draftContent
1904
        );
1905
    }
1906
1907
    /**
1908
     * Test for the publishVersion() method.