| @@ 1621-1642 (lines=22) @@ | ||
| 1618 | * |
|
| 1619 | * @return array |
|
| 1620 | */ |
|
| 1621 | public function testCreateContentDraft() |
|
| 1622 | { |
|
| 1623 | $time = time(); |
|
| 1624 | ||
| 1625 | /* BEGIN: Use Case */ |
|
| 1626 | $contentService = $this->repository->getContentService(); |
|
| 1627 | ||
| 1628 | $contentInfo = $contentService->loadContentInfo(4); |
|
| 1629 | ||
| 1630 | $draftContent = $contentService->createContentDraft($contentInfo); |
|
| 1631 | /* END: Use Case */ |
|
| 1632 | ||
| 1633 | $this->assertInstanceOf( |
|
| 1634 | 'eZ\\Publish\\API\\Repository\\Values\\Content\\Content', |
|
| 1635 | $draftContent |
|
| 1636 | ); |
|
| 1637 | ||
| 1638 | return array( |
|
| 1639 | 'draftContent' => $draftContent, |
|
| 1640 | 'time' => $time, |
|
| 1641 | ); |
|
| 1642 | } |
|
| 1643 | ||
| 1644 | /** |
|
| 1645 | * @param array $data |
|
| @@ 1684-1707 (lines=24) @@ | ||
| 1681 | * |
|
| 1682 | * @return array |
|
| 1683 | */ |
|
| 1684 | public function testCreateContentDraftWithSecondArgument() |
|
| 1685 | { |
|
| 1686 | $time = time(); |
|
| 1687 | ||
| 1688 | /* BEGIN: Use Case */ |
|
| 1689 | $contentService = $this->repository->getContentService(); |
|
| 1690 | $content = $contentService->loadContent(4); |
|
| 1691 | ||
| 1692 | $draftContent = $contentService->createContentDraft( |
|
| 1693 | $content->contentInfo, |
|
| 1694 | $content->getVersionInfo() |
|
| 1695 | ); |
|
| 1696 | /* END: Use Case */ |
|
| 1697 | ||
| 1698 | $this->assertInstanceOf( |
|
| 1699 | 'eZ\\Publish\\API\\Repository\\Values\\Content\\Content', |
|
| 1700 | $draftContent |
|
| 1701 | ); |
|
| 1702 | ||
| 1703 | return array( |
|
| 1704 | 'draftContent' => $draftContent, |
|
| 1705 | 'time' => $time, |
|
| 1706 | ); |
|
| 1707 | } |
|
| 1708 | ||
| 1709 | /** |
|
| 1710 | * Test for the createContentDraft() method. |
|
| @@ 1929-1946 (lines=18) @@ | ||
| 1926 | * |
|
| 1927 | * @return \eZ\Publish\API\Repository\Values\Content\VersionInfo[] |
|
| 1928 | */ |
|
| 1929 | public function testLoadVersionsMultiple() |
|
| 1930 | { |
|
| 1931 | $time = time(); |
|
| 1932 | ||
| 1933 | /* BEGIN: Use Case */ |
|
| 1934 | $contentService = $this->repository->getContentService(); |
|
| 1935 | ||
| 1936 | $contentInfo = $contentService->loadContentInfo(4); |
|
| 1937 | // Create one additional version |
|
| 1938 | $draftContent = $contentService->createContentDraft($contentInfo); |
|
| 1939 | $versions = $contentService->loadVersions($contentInfo); |
|
| 1940 | /* END: Use Case */ |
|
| 1941 | ||
| 1942 | return array( |
|
| 1943 | 'versions' => $versions, |
|
| 1944 | 'time' => $time, |
|
| 1945 | ); |
|
| 1946 | } |
|
| 1947 | ||
| 1948 | /** |
|
| 1949 | * Test for the loadVersions() method. |
|