Code Duplication    Length = 20-21 lines in 2 locations

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

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