|
@@ 1321-1334 (lines=14) @@
|
| 1318 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContent |
| 1319 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testCreateContentDraft |
| 1320 |
|
*/ |
| 1321 |
|
public function testCreateContentDraftLoadContentStillLoadsPublishedVersion() |
| 1322 |
|
{ |
| 1323 |
|
/* BEGIN: Use Case */ |
| 1324 |
|
$content = $this->createContentVersion1(); |
| 1325 |
|
|
| 1326 |
|
// Now we create a new draft from the published content |
| 1327 |
|
$this->contentService->createContentDraft($content->contentInfo); |
| 1328 |
|
|
| 1329 |
|
// This call will still load the published content version |
| 1330 |
|
$contentPublished = $this->contentService->loadContent($content->id); |
| 1331 |
|
/* END: Use Case */ |
| 1332 |
|
|
| 1333 |
|
$this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo); |
| 1334 |
|
} |
| 1335 |
|
|
| 1336 |
|
/** |
| 1337 |
|
* Test for the createContentDraft() method. |
|
@@ 1343-1356 (lines=14) @@
|
| 1340 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByRemoteId |
| 1341 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testCreateContentDraft |
| 1342 |
|
*/ |
| 1343 |
|
public function testCreateContentDraftLoadContentByRemoteIdStillLoadsPublishedVersion() |
| 1344 |
|
{ |
| 1345 |
|
/* BEGIN: Use Case */ |
| 1346 |
|
$content = $this->createContentVersion1(); |
| 1347 |
|
|
| 1348 |
|
// Now we create a new draft from the published content |
| 1349 |
|
$this->contentService->createContentDraft($content->contentInfo); |
| 1350 |
|
|
| 1351 |
|
// This call will still load the published content version |
| 1352 |
|
$contentPublished = $this->contentService->loadContentByRemoteId('abcdef0123456789abcdef0123456789'); |
| 1353 |
|
/* END: Use Case */ |
| 1354 |
|
|
| 1355 |
|
$this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo); |
| 1356 |
|
} |
| 1357 |
|
|
| 1358 |
|
/** |
| 1359 |
|
* Test for the createContentDraft() method. |
|
@@ 1365-1378 (lines=14) @@
|
| 1362 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfo |
| 1363 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testCreateContentDraft |
| 1364 |
|
*/ |
| 1365 |
|
public function testCreateContentDraftLoadContentByContentInfoStillLoadsPublishedVersion() |
| 1366 |
|
{ |
| 1367 |
|
/* BEGIN: Use Case */ |
| 1368 |
|
$content = $this->createContentVersion1(); |
| 1369 |
|
|
| 1370 |
|
// Now we create a new draft from the published content |
| 1371 |
|
$this->contentService->createContentDraft($content->contentInfo); |
| 1372 |
|
|
| 1373 |
|
// This call will still load the published content version |
| 1374 |
|
$contentPublished = $this->contentService->loadContentByContentInfo($content->contentInfo); |
| 1375 |
|
/* END: Use Case */ |
| 1376 |
|
|
| 1377 |
|
$this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo); |
| 1378 |
|
} |
| 1379 |
|
|
| 1380 |
|
/** |
| 1381 |
|
* Test for the newContentUpdateStruct() method. |
|
@@ 1730-1743 (lines=14) @@
|
| 1727 |
|
* @see \eZ\Publish\API\Repository\ContentService::createContentDraft($contentInfo, $versionInfo) |
| 1728 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
| 1729 |
|
*/ |
| 1730 |
|
public function testCreateContentDraftWithSecondParameter() |
| 1731 |
|
{ |
| 1732 |
|
/* BEGIN: Use Case */ |
| 1733 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1734 |
|
|
| 1735 |
|
// Now we create a new draft from the initial version |
| 1736 |
|
$draftedContentReloaded = $this->contentService->createContentDraft( |
| 1737 |
|
$contentVersion2->contentInfo, |
| 1738 |
|
$contentVersion2->getVersionInfo() |
| 1739 |
|
); |
| 1740 |
|
/* END: Use Case */ |
| 1741 |
|
|
| 1742 |
|
$this->assertEquals(3, $draftedContentReloaded->getVersionInfo()->versionNo); |
| 1743 |
|
} |
| 1744 |
|
|
| 1745 |
|
/** |
| 1746 |
|
* Test for the createContentDraft() method with third parameter. |