|
@@ 2118-2140 (lines=23) @@
|
| 2115 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo) |
| 2116 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2117 |
|
*/ |
| 2118 |
|
public function testLoadVersionInfoWithSecondParameter() |
| 2119 |
|
{ |
| 2120 |
|
$repository = $this->getRepository(); |
| 2121 |
|
|
| 2122 |
|
$contentService = $repository->getContentService(); |
| 2123 |
|
|
| 2124 |
|
/* BEGIN: Use Case */ |
| 2125 |
|
$publishedContent = $this->createContentVersion1(); |
| 2126 |
|
|
| 2127 |
|
$draftContent = $contentService->createContentDraft($publishedContent->contentInfo); |
| 2128 |
|
|
| 2129 |
|
// Will return the VersionInfo of the $draftContent |
| 2130 |
|
$versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2); |
| 2131 |
|
/* END: Use Case */ |
| 2132 |
|
|
| 2133 |
|
$this->assertEquals(2, $versionInfo->versionNo); |
| 2134 |
|
|
| 2135 |
|
// Check that ContentInfo contained in VersionInfo has correct main Location id set |
| 2136 |
|
$this->assertEquals( |
| 2137 |
|
$publishedContent->getVersionInfo()->getContentInfo()->mainLocationId, |
| 2138 |
|
$versionInfo->getContentInfo()->mainLocationId |
| 2139 |
|
); |
| 2140 |
|
} |
| 2141 |
|
|
| 2142 |
|
/** |
| 2143 |
|
* Test for the loadVersionInfo() method. |
|
@@ 2170-2192 (lines=23) @@
|
| 2167 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById($contentId, $versionNo) |
| 2168 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfoWithSecondParameter |
| 2169 |
|
*/ |
| 2170 |
|
public function testLoadVersionInfoByIdWithSecondParameter() |
| 2171 |
|
{ |
| 2172 |
|
$repository = $this->getRepository(); |
| 2173 |
|
|
| 2174 |
|
$contentService = $repository->getContentService(); |
| 2175 |
|
|
| 2176 |
|
/* BEGIN: Use Case */ |
| 2177 |
|
$publishedContent = $this->createContentVersion1(); |
| 2178 |
|
|
| 2179 |
|
$draftContent = $contentService->createContentDraft($publishedContent->contentInfo); |
| 2180 |
|
|
| 2181 |
|
// Will return the VersionInfo of the $draftContent |
| 2182 |
|
$versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2); |
| 2183 |
|
/* END: Use Case */ |
| 2184 |
|
|
| 2185 |
|
$this->assertEquals(2, $versionInfo->versionNo); |
| 2186 |
|
|
| 2187 |
|
// Check that ContentInfo contained in VersionInfo has correct main Location id set |
| 2188 |
|
$this->assertEquals( |
| 2189 |
|
$publishedContent->getVersionInfo()->getContentInfo()->mainLocationId, |
| 2190 |
|
$versionInfo->getContentInfo()->mainLocationId |
| 2191 |
|
); |
| 2192 |
|
} |
| 2193 |
|
|
| 2194 |
|
/** |
| 2195 |
|
* Test for the loadVersionInfoById() method. |