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.
@@ 1734-1753 (lines=20) @@
1731
     *
1732
     * @covers \eZ\Publish\Core\Repository\ContentService::createContentDraft
1733
     */
1734
    public function testCreateContentDraftWithThirdParameter()
1735
    {
1736
        $repository = $this->getRepository();
1737
1738
        $contentService = $repository->getContentService();
1739
1740
        $content = $contentService->loadContent(4);
1741
        $user = $this->createUserVersion1();
1742
1743
        $draftContent = $contentService->createContentDraft(
1744
            $content->contentInfo,
1745
            $content->getVersionInfo(),
1746
            $user
1747
        );
1748
1749
        $this->assertInstanceOf(
1750
            Content::class,
1751
            $draftContent
1752
        );
1753
    }
1754
1755
    /**
1756
     * Test for the publishVersion() method.