|
@@ 2064-2086 (lines=23) @@
|
| 2061 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo) |
| 2062 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2063 |
|
*/ |
| 2064 |
|
public function testLoadVersionInfoWithSecondParameter() |
| 2065 |
|
{ |
| 2066 |
|
$repository = $this->getRepository(); |
| 2067 |
|
|
| 2068 |
|
$contentService = $repository->getContentService(); |
| 2069 |
|
|
| 2070 |
|
/* BEGIN: Use Case */ |
| 2071 |
|
$publishedContent = $this->createContentVersion1(); |
| 2072 |
|
|
| 2073 |
|
$draftContent = $contentService->createContentDraft($publishedContent->contentInfo); |
| 2074 |
|
|
| 2075 |
|
// Will return the VersionInfo of the $draftContent |
| 2076 |
|
$versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2); |
| 2077 |
|
/* END: Use Case */ |
| 2078 |
|
|
| 2079 |
|
$this->assertEquals(2, $versionInfo->versionNo); |
| 2080 |
|
|
| 2081 |
|
// Check that ContentInfo contained in VersionInfo has correct main Location id set |
| 2082 |
|
$this->assertEquals( |
| 2083 |
|
$publishedContent->getVersionInfo()->getContentInfo()->mainLocationId, |
| 2084 |
|
$versionInfo->getContentInfo()->mainLocationId |
| 2085 |
|
); |
| 2086 |
|
} |
| 2087 |
|
|
| 2088 |
|
/** |
| 2089 |
|
* Test for the loadVersionInfo() method. |
|
@@ 2116-2138 (lines=23) @@
|
| 2113 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById($contentId, $versionNo) |
| 2114 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfoWithSecondParameter |
| 2115 |
|
*/ |
| 2116 |
|
public function testLoadVersionInfoByIdWithSecondParameter() |
| 2117 |
|
{ |
| 2118 |
|
$repository = $this->getRepository(); |
| 2119 |
|
|
| 2120 |
|
$contentService = $repository->getContentService(); |
| 2121 |
|
|
| 2122 |
|
/* BEGIN: Use Case */ |
| 2123 |
|
$publishedContent = $this->createContentVersion1(); |
| 2124 |
|
|
| 2125 |
|
$draftContent = $contentService->createContentDraft($publishedContent->contentInfo); |
| 2126 |
|
|
| 2127 |
|
// Will return the VersionInfo of the $draftContent |
| 2128 |
|
$versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2); |
| 2129 |
|
/* END: Use Case */ |
| 2130 |
|
|
| 2131 |
|
$this->assertEquals(2, $versionInfo->versionNo); |
| 2132 |
|
|
| 2133 |
|
// Check that ContentInfo contained in VersionInfo has correct main Location id set |
| 2134 |
|
$this->assertEquals( |
| 2135 |
|
$publishedContent->getVersionInfo()->getContentInfo()->mainLocationId, |
| 2136 |
|
$versionInfo->getContentInfo()->mainLocationId |
| 2137 |
|
); |
| 2138 |
|
} |
| 2139 |
|
|
| 2140 |
|
/** |
| 2141 |
|
* Test for the loadVersionInfoById() method. |