Code Duplication    Length = 20-21 lines in 2 locations

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

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