|
@@ 1914-1939 (lines=26) @@
|
| 1911 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
| 1912 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
| 1913 |
|
*/ |
| 1914 |
|
public function testPublishVersionFromContentDraft() |
| 1915 |
|
{ |
| 1916 |
|
$repository = $this->getRepository(); |
| 1917 |
|
|
| 1918 |
|
$contentService = $repository->getContentService(); |
| 1919 |
|
|
| 1920 |
|
/* BEGIN: Use Case */ |
| 1921 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1922 |
|
/* END: Use Case */ |
| 1923 |
|
|
| 1924 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo); |
| 1925 |
|
|
| 1926 |
|
$this->assertEquals( |
| 1927 |
|
array( |
| 1928 |
|
'status' => VersionInfo::STATUS_PUBLISHED, |
| 1929 |
|
'versionNo' => 2, |
| 1930 |
|
), |
| 1931 |
|
array( |
| 1932 |
|
'status' => $versionInfo->status, |
| 1933 |
|
'versionNo' => $versionInfo->versionNo, |
| 1934 |
|
) |
| 1935 |
|
); |
| 1936 |
|
$this->assertTrue($versionInfo->isPublished()); |
| 1937 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1938 |
|
$this->assertFalse($versionInfo->isArchived()); |
| 1939 |
|
} |
| 1940 |
|
|
| 1941 |
|
/** |
| 1942 |
|
* Test for the publishVersion() method. |
|
@@ 1947-1972 (lines=26) @@
|
| 1944 |
|
* @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
| 1945 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1946 |
|
*/ |
| 1947 |
|
public function testPublishVersionFromContentDraftArchivesOldVersion() |
| 1948 |
|
{ |
| 1949 |
|
$repository = $this->getRepository(); |
| 1950 |
|
|
| 1951 |
|
$contentService = $repository->getContentService(); |
| 1952 |
|
|
| 1953 |
|
/* BEGIN: Use Case */ |
| 1954 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1955 |
|
/* END: Use Case */ |
| 1956 |
|
|
| 1957 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo, 1); |
| 1958 |
|
|
| 1959 |
|
$this->assertEquals( |
| 1960 |
|
array( |
| 1961 |
|
'status' => VersionInfo::STATUS_ARCHIVED, |
| 1962 |
|
'versionNo' => 1, |
| 1963 |
|
), |
| 1964 |
|
array( |
| 1965 |
|
'status' => $versionInfo->status, |
| 1966 |
|
'versionNo' => $versionInfo->versionNo, |
| 1967 |
|
) |
| 1968 |
|
); |
| 1969 |
|
$this->assertTrue($versionInfo->isArchived()); |
| 1970 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1971 |
|
$this->assertFalse($versionInfo->isPublished()); |
| 1972 |
|
} |
| 1973 |
|
|
| 1974 |
|
/** |
| 1975 |
|
* Test for the publishVersion() method. |