Code Duplication    Length = 13-18 lines in 2 locations

eZ/Publish/Core/Repository/Tests/Service/Integration/ContentBase.php 1 location

@@ 1772-1784 (lines=13) @@
1769
     * @covers \eZ\Publish\Core\Repository\ContentService::createContentDraft
1770
     * @expectedException \eZ\Publish\API\Repository\Exceptions\BadStateException
1771
     */
1772
    public function testCreateContentDraftThrowsBadStateException()
1773
    {
1774
        $contentService = $this->repository->getContentService();
1775
        $contentInfo = $contentService->loadContentInfo(4);
1776
        $draftContent = $contentService->createContentDraft($contentInfo);
1777
1778
        // Throws an exception because version status is not
1779
        // VersionInfo::STATUS_PUBLISHED nor VersionInfo::STATUS_ARCHIVED
1780
        $draftContent = $contentService->createContentDraft(
1781
            $draftContent->contentInfo,
1782
            $draftContent->getVersionInfo()
1783
        );
1784
    }
1785
1786
    /**
1787
     * Test for the createContentDraft() method.

eZ/Publish/API/Repository/Tests/ContentServiceTest.php 1 location

@@ 1538-1555 (lines=18) @@
1535
     * @see \eZ\Publish\API\Repository\ContentService::createContentDraft($contentInfo, $versionInfo)
1536
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent
1537
     */
1538
    public function testCreateContentDraftWithSecondParameter()
1539
    {
1540
        $repository = $this->getRepository();
1541
1542
        $contentService = $repository->getContentService();
1543
1544
        /* BEGIN: Use Case */
1545
        $contentVersion2 = $this->createContentVersion2();
1546
1547
        // Now we create a new draft from the initial version
1548
        $draftedContentReloaded = $contentService->createContentDraft(
1549
            $contentVersion2->contentInfo,
1550
            $contentVersion2->getVersionInfo()
1551
        );
1552
        /* END: Use Case */
1553
1554
        $this->assertEquals(3, $draftedContentReloaded->getVersionInfo()->versionNo);
1555
    }
1556
1557
    /**
1558
     * Test for the publishVersion() method.