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

@@ 1585-1602 (lines=18) @@
1582
     * @see \eZ\Publish\API\Repository\ContentService::createContentDraft($contentInfo, $versionInfo)
1583
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent
1584
     */
1585
    public function testCreateContentDraftWithSecondParameter()
1586
    {
1587
        $repository = $this->getRepository();
1588
1589
        $contentService = $repository->getContentService();
1590
1591
        /* BEGIN: Use Case */
1592
        $contentVersion2 = $this->createContentVersion2();
1593
1594
        // Now we create a new draft from the initial version
1595
        $draftedContentReloaded = $contentService->createContentDraft(
1596
            $contentVersion2->contentInfo,
1597
            $contentVersion2->getVersionInfo()
1598
        );
1599
        /* END: Use Case */
1600
1601
        $this->assertEquals(3, $draftedContentReloaded->getVersionInfo()->versionNo);
1602
    }
1603
1604
    /**
1605
     * Test for the publishVersion() method.