|
@@ 1821-1846 (lines=26) @@
|
| 1818 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
| 1819 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
| 1820 |
|
*/ |
| 1821 |
|
public function testPublishVersionFromContentDraft() |
| 1822 |
|
{ |
| 1823 |
|
$repository = $this->getRepository(); |
| 1824 |
|
|
| 1825 |
|
$contentService = $repository->getContentService(); |
| 1826 |
|
|
| 1827 |
|
/* BEGIN: Use Case */ |
| 1828 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1829 |
|
/* END: Use Case */ |
| 1830 |
|
|
| 1831 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo); |
| 1832 |
|
|
| 1833 |
|
$this->assertEquals( |
| 1834 |
|
[ |
| 1835 |
|
'status' => VersionInfo::STATUS_PUBLISHED, |
| 1836 |
|
'versionNo' => 2, |
| 1837 |
|
], |
| 1838 |
|
[ |
| 1839 |
|
'status' => $versionInfo->status, |
| 1840 |
|
'versionNo' => $versionInfo->versionNo, |
| 1841 |
|
] |
| 1842 |
|
); |
| 1843 |
|
$this->assertTrue($versionInfo->isPublished()); |
| 1844 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1845 |
|
$this->assertFalse($versionInfo->isArchived()); |
| 1846 |
|
} |
| 1847 |
|
|
| 1848 |
|
/** |
| 1849 |
|
* Test for the publishVersion() method. |
|
@@ 1854-1879 (lines=26) @@
|
| 1851 |
|
* @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
| 1852 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1853 |
|
*/ |
| 1854 |
|
public function testPublishVersionFromContentDraftArchivesOldVersion() |
| 1855 |
|
{ |
| 1856 |
|
$repository = $this->getRepository(); |
| 1857 |
|
|
| 1858 |
|
$contentService = $repository->getContentService(); |
| 1859 |
|
|
| 1860 |
|
/* BEGIN: Use Case */ |
| 1861 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1862 |
|
/* END: Use Case */ |
| 1863 |
|
|
| 1864 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo, 1); |
| 1865 |
|
|
| 1866 |
|
$this->assertEquals( |
| 1867 |
|
[ |
| 1868 |
|
'status' => VersionInfo::STATUS_ARCHIVED, |
| 1869 |
|
'versionNo' => 1, |
| 1870 |
|
], |
| 1871 |
|
[ |
| 1872 |
|
'status' => $versionInfo->status, |
| 1873 |
|
'versionNo' => $versionInfo->versionNo, |
| 1874 |
|
] |
| 1875 |
|
); |
| 1876 |
|
$this->assertTrue($versionInfo->isArchived()); |
| 1877 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1878 |
|
$this->assertFalse($versionInfo->isPublished()); |
| 1879 |
|
} |
| 1880 |
|
|
| 1881 |
|
/** |
| 1882 |
|
* Test for the publishVersion() method. |