Code Duplication    Length = 20-21 lines in 2 locations

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

@@ 1171-1191 (lines=21) @@
1168
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion
1169
     * @group user
1170
     */
1171
    public function testCreateContentDraftAndLoadAccess()
1172
    {
1173
        $repository = $this->getRepository();
1174
1175
        /* BEGIN: Use Case */
1176
        $user = $this->createUserVersion1();
1177
1178
        // Set new editor as user
1179
        $repository->setCurrentUser($user);
1180
1181
        // Create draft
1182
        $draft = $this->createContentDraftVersion1(2, 'folder');
1183
1184
        // Try to load the draft
1185
        $contentService = $repository->getContentService();
1186
        $loadedDraft = $contentService->loadContent($draft->id);
1187
1188
        /* END: Use Case */
1189
1190
        $this->assertEquals($draft->id, $loadedDraft->id);
1191
    }
1192
1193
    /**
1194
     * Test for the createContentDraft() method.
@@ 1731-1750 (lines=20) @@
1728
     *
1729
     * @covers \eZ\Publish\Core\Repository\ContentService::createContentDraft
1730
     */
1731
    public function testCreateContentDraftWithThirdParameter()
1732
    {
1733
        $repository = $this->getRepository();
1734
1735
        $contentService = $repository->getContentService();
1736
1737
        $content = $contentService->loadContent(4);
1738
        $user = $this->createUserVersion1();
1739
1740
        $draftContent = $contentService->createContentDraft(
1741
            $content->contentInfo,
1742
            $content->getVersionInfo(),
1743
            $user
1744
        );
1745
1746
        $this->assertInstanceOf(
1747
            Content::class,
1748
            $draftContent
1749
        );
1750
    }
1751
1752
    /**
1753
     * Test for the publishVersion() method.