Code Duplication    Length = 20-21 lines in 2 locations

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

@@ 1172-1192 (lines=21) @@
1169
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion
1170
     * @group user
1171
     */
1172
    public function testCreateContentDraftAndLoadAccess()
1173
    {
1174
        $repository = $this->getRepository();
1175
1176
        /* BEGIN: Use Case */
1177
        $user = $this->createUserVersion1();
1178
1179
        // Set new editor as user
1180
        $repository->setCurrentUser($user);
1181
1182
        // Create draft
1183
        $draft = $this->createContentDraftVersion1(2, 'folder');
1184
1185
        // Try to load the draft
1186
        $contentService = $repository->getContentService();
1187
        $loadedDraft = $contentService->loadContent($draft->id);
1188
1189
        /* END: Use Case */
1190
1191
        $this->assertEquals($draft->id, $loadedDraft->id);
1192
    }
1193
1194
    /**
1195
     * Test for the createContentDraft() method.
@@ 1790-1809 (lines=20) @@
1787
     *
1788
     * @covers \eZ\Publish\Core\Repository\ContentService::createContentDraft
1789
     */
1790
    public function testCreateContentDraftWithThirdParameter()
1791
    {
1792
        $repository = $this->getRepository();
1793
1794
        $contentService = $repository->getContentService();
1795
1796
        $content = $contentService->loadContent(4);
1797
        $user = $this->createUserVersion1();
1798
1799
        $draftContent = $contentService->createContentDraft(
1800
            $content->contentInfo,
1801
            $content->getVersionInfo(),
1802
            $user
1803
        );
1804
1805
        $this->assertInstanceOf(
1806
            Content::class,
1807
            $draftContent
1808
        );
1809
    }
1810
1811
    /**
1812
     * Test for the publishVersion() method.