|
@@ 1933-1958 (lines=26) @@
|
| 1930 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
| 1931 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
| 1932 |
|
*/ |
| 1933 |
|
public function testPublishVersionFromContentDraft() |
| 1934 |
|
{ |
| 1935 |
|
$repository = $this->getRepository(); |
| 1936 |
|
|
| 1937 |
|
$contentService = $repository->getContentService(); |
| 1938 |
|
|
| 1939 |
|
/* BEGIN: Use Case */ |
| 1940 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1941 |
|
/* END: Use Case */ |
| 1942 |
|
|
| 1943 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo); |
| 1944 |
|
|
| 1945 |
|
$this->assertEquals( |
| 1946 |
|
[ |
| 1947 |
|
'status' => VersionInfo::STATUS_PUBLISHED, |
| 1948 |
|
'versionNo' => 2, |
| 1949 |
|
], |
| 1950 |
|
[ |
| 1951 |
|
'status' => $versionInfo->status, |
| 1952 |
|
'versionNo' => $versionInfo->versionNo, |
| 1953 |
|
] |
| 1954 |
|
); |
| 1955 |
|
$this->assertTrue($versionInfo->isPublished()); |
| 1956 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1957 |
|
$this->assertFalse($versionInfo->isArchived()); |
| 1958 |
|
} |
| 1959 |
|
|
| 1960 |
|
/** |
| 1961 |
|
* Test for the publishVersion() method. |
|
@@ 1966-1991 (lines=26) @@
|
| 1963 |
|
* @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
| 1964 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1965 |
|
*/ |
| 1966 |
|
public function testPublishVersionFromContentDraftArchivesOldVersion() |
| 1967 |
|
{ |
| 1968 |
|
$repository = $this->getRepository(); |
| 1969 |
|
|
| 1970 |
|
$contentService = $repository->getContentService(); |
| 1971 |
|
|
| 1972 |
|
/* BEGIN: Use Case */ |
| 1973 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1974 |
|
/* END: Use Case */ |
| 1975 |
|
|
| 1976 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo, 1); |
| 1977 |
|
|
| 1978 |
|
$this->assertEquals( |
| 1979 |
|
[ |
| 1980 |
|
'status' => VersionInfo::STATUS_ARCHIVED, |
| 1981 |
|
'versionNo' => 1, |
| 1982 |
|
], |
| 1983 |
|
[ |
| 1984 |
|
'status' => $versionInfo->status, |
| 1985 |
|
'versionNo' => $versionInfo->versionNo, |
| 1986 |
|
] |
| 1987 |
|
); |
| 1988 |
|
$this->assertTrue($versionInfo->isArchived()); |
| 1989 |
|
$this->assertFalse($versionInfo->isDraft()); |
| 1990 |
|
$this->assertFalse($versionInfo->isPublished()); |
| 1991 |
|
} |
| 1992 |
|
|
| 1993 |
|
/** |
| 1994 |
|
* Test for the publishVersion() method. |