@@ 1758-1783 (lines=26) @@ | ||
1755 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
|
1756 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
|
1757 | */ |
|
1758 | public function testPublishVersionFromContentDraft() |
|
1759 | { |
|
1760 | $repository = $this->getRepository(); |
|
1761 | ||
1762 | $contentService = $repository->getContentService(); |
|
1763 | ||
1764 | /* BEGIN: Use Case */ |
|
1765 | $contentVersion2 = $this->createContentVersion2(); |
|
1766 | /* END: Use Case */ |
|
1767 | ||
1768 | $versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo); |
|
1769 | ||
1770 | $this->assertEquals( |
|
1771 | array( |
|
1772 | 'status' => VersionInfo::STATUS_PUBLISHED, |
|
1773 | 'versionNo' => 2, |
|
1774 | ), |
|
1775 | array( |
|
1776 | 'status' => $versionInfo->status, |
|
1777 | 'versionNo' => $versionInfo->versionNo, |
|
1778 | ) |
|
1779 | ); |
|
1780 | $this->assertTrue($versionInfo->isPublished()); |
|
1781 | $this->assertFalse($versionInfo->isDraft()); |
|
1782 | $this->assertFalse($versionInfo->isArchived()); |
|
1783 | } |
|
1784 | ||
1785 | /** |
|
1786 | * Test for the publishVersion() method. |
|
@@ 1791-1816 (lines=26) @@ | ||
1788 | * @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
|
1789 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
|
1790 | */ |
|
1791 | public function testPublishVersionFromContentDraftArchivesOldVersion() |
|
1792 | { |
|
1793 | $repository = $this->getRepository(); |
|
1794 | ||
1795 | $contentService = $repository->getContentService(); |
|
1796 | ||
1797 | /* BEGIN: Use Case */ |
|
1798 | $contentVersion2 = $this->createContentVersion2(); |
|
1799 | /* END: Use Case */ |
|
1800 | ||
1801 | $versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo, 1); |
|
1802 | ||
1803 | $this->assertEquals( |
|
1804 | array( |
|
1805 | 'status' => VersionInfo::STATUS_ARCHIVED, |
|
1806 | 'versionNo' => 1, |
|
1807 | ), |
|
1808 | array( |
|
1809 | 'status' => $versionInfo->status, |
|
1810 | 'versionNo' => $versionInfo->versionNo, |
|
1811 | ) |
|
1812 | ); |
|
1813 | $this->assertTrue($versionInfo->isArchived()); |
|
1814 | $this->assertFalse($versionInfo->isDraft()); |
|
1815 | $this->assertFalse($versionInfo->isPublished()); |
|
1816 | } |
|
1817 | ||
1818 | /** |
|
1819 | * Test for the publishVersion() method. |