Code Duplication    Length = 20-21 lines in 2 locations

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

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