|
@@ 1612-1634 (lines=23) @@
|
| 1609 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
| 1610 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent |
| 1611 |
|
*/ |
| 1612 |
|
public function testPublishVersionFromContentDraft() |
| 1613 |
|
{ |
| 1614 |
|
$repository = $this->getRepository(); |
| 1615 |
|
|
| 1616 |
|
$contentService = $repository->getContentService(); |
| 1617 |
|
|
| 1618 |
|
/* BEGIN: Use Case */ |
| 1619 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1620 |
|
/* END: Use Case */ |
| 1621 |
|
|
| 1622 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo); |
| 1623 |
|
|
| 1624 |
|
$this->assertEquals( |
| 1625 |
|
array( |
| 1626 |
|
'status' => VersionInfo::STATUS_PUBLISHED, |
| 1627 |
|
'versionNo' => 2, |
| 1628 |
|
), |
| 1629 |
|
array( |
| 1630 |
|
'status' => $versionInfo->status, |
| 1631 |
|
'versionNo' => $versionInfo->versionNo, |
| 1632 |
|
) |
| 1633 |
|
); |
| 1634 |
|
} |
| 1635 |
|
|
| 1636 |
|
/** |
| 1637 |
|
* Test for the publishVersion() method. |
|
@@ 1642-1664 (lines=23) @@
|
| 1639 |
|
* @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
| 1640 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1641 |
|
*/ |
| 1642 |
|
public function testPublishVersionFromContentDraftArchivesOldVersion() |
| 1643 |
|
{ |
| 1644 |
|
$repository = $this->getRepository(); |
| 1645 |
|
|
| 1646 |
|
$contentService = $repository->getContentService(); |
| 1647 |
|
|
| 1648 |
|
/* BEGIN: Use Case */ |
| 1649 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1650 |
|
/* END: Use Case */ |
| 1651 |
|
|
| 1652 |
|
$versionInfo = $contentService->loadVersionInfo($contentVersion2->contentInfo, 1); |
| 1653 |
|
|
| 1654 |
|
$this->assertEquals( |
| 1655 |
|
array( |
| 1656 |
|
'status' => VersionInfo::STATUS_ARCHIVED, |
| 1657 |
|
'versionNo' => 1, |
| 1658 |
|
), |
| 1659 |
|
array( |
| 1660 |
|
'status' => $versionInfo->status, |
| 1661 |
|
'versionNo' => $versionInfo->versionNo, |
| 1662 |
|
) |
| 1663 |
|
); |
| 1664 |
|
} |
| 1665 |
|
|
| 1666 |
|
/** |
| 1667 |
|
* Test for the publishVersion() method. |