|
@@ 1875-1900 (lines=26) @@
|
| 1872 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
| 1873 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
| 1874 |
|
*/ |
| 1875 |
|
public function testPublishVersionFromContentDraft() |
| 1876 |
|
{ |
| 1877 |
|
$repository = $this->getRepository(); |
| 1878 |
|
|
| 1879 |
|
$contentService = $repository->getContentService(); |
| 1880 |
|
|
| 1881 |
|
/* BEGIN: Use Case */ |
| 1882 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1883 |
|
/* END: Use Case */ |
| 1884 |
|
|
| 1885 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo); |
| 1886 |
|
|
| 1887 |
|
$this->assertEquals( |
| 1888 |
|
array( |
| 1889 |
|
'status' => VersionInfo::STATUS_PUBLISHED, |
| 1890 |
|
'versionNo' => 2, |
| 1891 |
|
), |
| 1892 |
|
array( |
| 1893 |
|
'status' => $versionInfo->status, |
| 1894 |
|
'versionNo' => $versionInfo->versionNo, |
| 1895 |
|
) |
| 1896 |
|
); |
| 1897 |
|
$this->assertTrue($versionInfo->isPublished()); |
| 1898 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1899 |
|
$this->assertFalse($versionInfo->isArchived()); |
| 1900 |
|
} |
| 1901 |
|
|
| 1902 |
|
/** |
| 1903 |
|
* Test for the publishVersion() method. |
|
@@ 1908-1933 (lines=26) @@
|
| 1905 |
|
* @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
| 1906 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1907 |
|
*/ |
| 1908 |
|
public function testPublishVersionFromContentDraftArchivesOldVersion() |
| 1909 |
|
{ |
| 1910 |
|
$repository = $this->getRepository(); |
| 1911 |
|
|
| 1912 |
|
$contentService = $repository->getContentService(); |
| 1913 |
|
|
| 1914 |
|
/* BEGIN: Use Case */ |
| 1915 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1916 |
|
/* END: Use Case */ |
| 1917 |
|
|
| 1918 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo, 1); |
| 1919 |
|
|
| 1920 |
|
$this->assertEquals( |
| 1921 |
|
array( |
| 1922 |
|
'status' => VersionInfo::STATUS_ARCHIVED, |
| 1923 |
|
'versionNo' => 1, |
| 1924 |
|
), |
| 1925 |
|
array( |
| 1926 |
|
'status' => $versionInfo->status, |
| 1927 |
|
'versionNo' => $versionInfo->versionNo, |
| 1928 |
|
) |
| 1929 |
|
); |
| 1930 |
|
$this->assertTrue($versionInfo->isArchived()); |
| 1931 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1932 |
|
$this->assertFalse($versionInfo->isPublished()); |
| 1933 |
|
} |
| 1934 |
|
|
| 1935 |
|
/** |
| 1936 |
|
* Test for the publishVersion() method. |