|
@@ 519-537 (lines=19) @@
|
| 516 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentInfo() |
| 517 |
|
* @group user |
| 518 |
|
*/ |
| 519 |
|
public function testLoadContentInfo() |
| 520 |
|
{ |
| 521 |
|
$repository = $this->getRepository(); |
| 522 |
|
|
| 523 |
|
$mediaFolderId = $this->generateId('object', 41); |
| 524 |
|
/* BEGIN: Use Case */ |
| 525 |
|
$contentService = $repository->getContentService(); |
| 526 |
|
|
| 527 |
|
// Load the ContentInfo for "Media" folder |
| 528 |
|
$contentInfo = $contentService->loadContentInfo($mediaFolderId); |
| 529 |
|
/* END: Use Case */ |
| 530 |
|
|
| 531 |
|
$this->assertInstanceOf( |
| 532 |
|
'\\eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo', |
| 533 |
|
$contentInfo |
| 534 |
|
); |
| 535 |
|
|
| 536 |
|
return $contentInfo; |
| 537 |
|
} |
| 538 |
|
|
| 539 |
|
/** |
| 540 |
|
* Test for the returned value of the loadContentInfo() method. |
|
@@ 718-738 (lines=21) @@
|
| 715 |
|
* |
| 716 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById() |
| 717 |
|
*/ |
| 718 |
|
public function testLoadVersionInfoById() |
| 719 |
|
{ |
| 720 |
|
$repository = $this->getRepository(); |
| 721 |
|
|
| 722 |
|
$mediaFolderId = $this->generateId('object', 41); |
| 723 |
|
/* BEGIN: Use Case */ |
| 724 |
|
// $mediaFolderId contains the ID of the "Media" folder |
| 725 |
|
|
| 726 |
|
$contentService = $repository->getContentService(); |
| 727 |
|
|
| 728 |
|
// Load the VersionInfo for "Media" folder |
| 729 |
|
$versionInfo = $contentService->loadVersionInfoById($mediaFolderId); |
| 730 |
|
/* END: Use Case */ |
| 731 |
|
|
| 732 |
|
$this->assertInstanceOf( |
| 733 |
|
'\\eZ\\Publish\\API\\Repository\\Values\\Content\\VersionInfo', |
| 734 |
|
$versionInfo |
| 735 |
|
); |
| 736 |
|
|
| 737 |
|
return $versionInfo; |
| 738 |
|
} |
| 739 |
|
|
| 740 |
|
/** |
| 741 |
|
* Test for the returned value of the loadVersionInfoById() method. |
|
@@ 862-880 (lines=19) @@
|
| 859 |
|
* @group user |
| 860 |
|
* @group field-type |
| 861 |
|
*/ |
| 862 |
|
public function testLoadContent() |
| 863 |
|
{ |
| 864 |
|
$repository = $this->getRepository(); |
| 865 |
|
|
| 866 |
|
$mediaFolderId = $this->generateId('object', 41); |
| 867 |
|
/* BEGIN: Use Case */ |
| 868 |
|
// $mediaFolderId contains the ID of the "Media" folder |
| 869 |
|
|
| 870 |
|
$contentService = $repository->getContentService(); |
| 871 |
|
|
| 872 |
|
// Load the Content for "Media" folder, any language and current version |
| 873 |
|
$content = $contentService->loadContent($mediaFolderId); |
| 874 |
|
/* END: Use Case */ |
| 875 |
|
|
| 876 |
|
$this->assertInstanceOf( |
| 877 |
|
'\\eZ\\Publish\\API\\Repository\\Values\\Content\\Content', |
| 878 |
|
$content |
| 879 |
|
); |
| 880 |
|
} |
| 881 |
|
|
| 882 |
|
/** |
| 883 |
|
* Test for the loadContent() method. |