|
@@ 653-670 (lines=18) @@
|
| 650 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentInfo |
| 651 |
|
* @group user |
| 652 |
|
*/ |
| 653 |
|
public function testLoadVersionInfo() |
| 654 |
|
{ |
| 655 |
|
$mediaFolderId = $this->generateId('object', 41); |
| 656 |
|
/* BEGIN: Use Case */ |
| 657 |
|
// $mediaFolderId contains the ID of the "Media" folder |
| 658 |
|
|
| 659 |
|
// Load the ContentInfo for "Media" folder |
| 660 |
|
$contentInfo = $this->contentService->loadContentInfo($mediaFolderId); |
| 661 |
|
|
| 662 |
|
// Now load the current version info of the "Media" folder |
| 663 |
|
$versionInfo = $this->contentService->loadVersionInfo($contentInfo); |
| 664 |
|
/* END: Use Case */ |
| 665 |
|
|
| 666 |
|
$this->assertInstanceOf( |
| 667 |
|
VersionInfo::class, |
| 668 |
|
$versionInfo |
| 669 |
|
); |
| 670 |
|
} |
| 671 |
|
|
| 672 |
|
/** |
| 673 |
|
* Test for the loadVersionInfoById() method. |
|
@@ 752-769 (lines=18) @@
|
| 749 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByContentInfo() |
| 750 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentInfo |
| 751 |
|
*/ |
| 752 |
|
public function testLoadContentByContentInfo() |
| 753 |
|
{ |
| 754 |
|
$mediaFolderId = $this->generateId('object', 41); |
| 755 |
|
/* BEGIN: Use Case */ |
| 756 |
|
// $mediaFolderId contains the ID of the "Media" folder |
| 757 |
|
|
| 758 |
|
// Load the ContentInfo for "Media" folder |
| 759 |
|
$contentInfo = $this->contentService->loadContentInfo($mediaFolderId); |
| 760 |
|
|
| 761 |
|
// Now load the current content version for the info instance |
| 762 |
|
$content = $this->contentService->loadContentByContentInfo($contentInfo); |
| 763 |
|
/* END: Use Case */ |
| 764 |
|
|
| 765 |
|
$this->assertInstanceOf( |
| 766 |
|
Content::class, |
| 767 |
|
$content |
| 768 |
|
); |
| 769 |
|
} |
| 770 |
|
|
| 771 |
|
/** |
| 772 |
|
* Test for the loadContentByVersionInfo() method. |
|
@@ 777-797 (lines=21) @@
|
| 774 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByVersionInfo() |
| 775 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfo |
| 776 |
|
*/ |
| 777 |
|
public function testLoadContentByVersionInfo() |
| 778 |
|
{ |
| 779 |
|
$mediaFolderId = $this->generateId('object', 41); |
| 780 |
|
/* BEGIN: Use Case */ |
| 781 |
|
// $mediaFolderId contains the ID of the "Media" folder |
| 782 |
|
|
| 783 |
|
// Load the ContentInfo for "Media" folder |
| 784 |
|
$contentInfo = $this->contentService->loadContentInfo($mediaFolderId); |
| 785 |
|
|
| 786 |
|
// Load the current VersionInfo |
| 787 |
|
$versionInfo = $this->contentService->loadVersionInfo($contentInfo); |
| 788 |
|
|
| 789 |
|
// Now load the current content version for the info instance |
| 790 |
|
$content = $this->contentService->loadContentByVersionInfo($versionInfo); |
| 791 |
|
/* END: Use Case */ |
| 792 |
|
|
| 793 |
|
$this->assertInstanceOf( |
| 794 |
|
Content::class, |
| 795 |
|
$content |
| 796 |
|
); |
| 797 |
|
} |
| 798 |
|
|
| 799 |
|
/** |
| 800 |
|
* Test for the loadContent() method. |