Code Duplication    Length = 20-21 lines in 2 locations

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

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