Code Duplication    Length = 20-21 lines in 2 locations

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

@@ 1159-1179 (lines=21) @@
1156
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion
1157
     * @group user
1158
     */
1159
    public function testCreateContentDraftAndLoadAccess()
1160
    {
1161
        $repository = $this->getRepository();
1162
1163
        /* BEGIN: Use Case */
1164
        $user = $this->createUserVersion1();
1165
1166
        // Set new editor as user
1167
        $repository->setCurrentUser($user);
1168
1169
        // Create draft
1170
        $draft = $this->createContentDraftVersion1(2, 'folder');
1171
1172
        // Try to load the draft
1173
        $contentService = $repository->getContentService();
1174
        $loadedDraft = $contentService->loadContent($draft->id);
1175
1176
        /* END: Use Case */
1177
1178
        $this->assertEquals($draft->id, $loadedDraft->id);
1179
    }
1180
1181
    /**
1182
     * Test for the createContentDraft() method.
@@ 1716-1735 (lines=20) @@
1713
     *
1714
     * @covers \eZ\Publish\Core\Repository\ContentService::createContentDraft
1715
     */
1716
    public function testCreateContentDraftWithThirdParameter()
1717
    {
1718
        $repository = $this->getRepository();
1719
1720
        $contentService = $repository->getContentService();
1721
1722
        $content = $contentService->loadContent(4);
1723
        $user = $this->createUserVersion1();
1724
1725
        $draftContent = $contentService->createContentDraft(
1726
            $content->contentInfo,
1727
            $content->getVersionInfo(),
1728
            $user
1729
        );
1730
1731
        $this->assertInstanceOf(
1732
            Content::class,
1733
            $draftContent
1734
        );
1735
    }
1736
1737
    /**
1738
     * Test for the publishVersion() method.