|
@@ 1558-1580 (lines=23) @@
|
| 1555 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
| 1556 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
| 1557 |
|
*/ |
| 1558 |
|
public function testPublishVersionFromContentDraft() |
| 1559 |
|
{ |
| 1560 |
|
$repository = $this->getRepository(); |
| 1561 |
|
|
| 1562 |
|
$contentService = $repository->getContentService(); |
| 1563 |
|
|
| 1564 |
|
/* BEGIN: Use Case */ |
| 1565 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1566 |
|
/* END: Use Case */ |
| 1567 |
|
|
| 1568 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo); |
| 1569 |
|
|
| 1570 |
|
$this->assertEquals( |
| 1571 |
|
array( |
| 1572 |
|
'status' => VersionInfo::STATUS_PUBLISHED, |
| 1573 |
|
'versionNo' => 2, |
| 1574 |
|
), |
| 1575 |
|
array( |
| 1576 |
|
'status' => $versionInfo->status, |
| 1577 |
|
'versionNo' => $versionInfo->versionNo, |
| 1578 |
|
) |
| 1579 |
|
); |
| 1580 |
|
} |
| 1581 |
|
|
| 1582 |
|
/** |
| 1583 |
|
* Test for the publishVersion() method. |
|
@@ 1588-1610 (lines=23) @@
|
| 1585 |
|
* @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
| 1586 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1587 |
|
*/ |
| 1588 |
|
public function testPublishVersionFromContentDraftArchivesOldVersion() |
| 1589 |
|
{ |
| 1590 |
|
$repository = $this->getRepository(); |
| 1591 |
|
|
| 1592 |
|
$contentService = $repository->getContentService(); |
| 1593 |
|
|
| 1594 |
|
/* BEGIN: Use Case */ |
| 1595 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1596 |
|
/* END: Use Case */ |
| 1597 |
|
|
| 1598 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo, 1); |
| 1599 |
|
|
| 1600 |
|
$this->assertEquals( |
| 1601 |
|
array( |
| 1602 |
|
'status' => VersionInfo::STATUS_ARCHIVED, |
| 1603 |
|
'versionNo' => 1, |
| 1604 |
|
), |
| 1605 |
|
array( |
| 1606 |
|
'status' => $versionInfo->status, |
| 1607 |
|
'versionNo' => $versionInfo->versionNo, |
| 1608 |
|
) |
| 1609 |
|
); |
| 1610 |
|
} |
| 1611 |
|
|
| 1612 |
|
/** |
| 1613 |
|
* Test for the publishVersion() method. |