|
@@ 2809-2825 (lines=17) @@
|
| 2806 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages) |
| 2807 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2808 |
|
*/ |
| 2809 |
|
public function testLoadContentWithSecondParameter() |
| 2810 |
|
{ |
| 2811 |
|
$repository = $this->getRepository(); |
| 2812 |
|
|
| 2813 |
|
$contentService = $repository->getContentService(); |
| 2814 |
|
|
| 2815 |
|
/* BEGIN: Use Case */ |
| 2816 |
|
$draft = $this->createMultipleLanguageDraftVersion1(); |
| 2817 |
|
|
| 2818 |
|
// This draft contains those fields localized with "eng-GB" |
| 2819 |
|
$draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false); |
| 2820 |
|
/* END: Use Case */ |
| 2821 |
|
|
| 2822 |
|
$this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
| 2823 |
|
|
| 2824 |
|
return $draft; |
| 2825 |
|
} |
| 2826 |
|
|
| 2827 |
|
/** |
| 2828 |
|
* Test for the loadContent() method using undefined translation. |
|
@@ 2902-2923 (lines=22) @@
|
| 2899 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages) |
| 2900 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2901 |
|
*/ |
| 2902 |
|
public function testLoadContentByRemoteIdWithSecondParameter() |
| 2903 |
|
{ |
| 2904 |
|
$repository = $this->getRepository(); |
| 2905 |
|
|
| 2906 |
|
$contentService = $repository->getContentService(); |
| 2907 |
|
|
| 2908 |
|
/* BEGIN: Use Case */ |
| 2909 |
|
$draft = $this->createMultipleLanguageDraftVersion1(); |
| 2910 |
|
|
| 2911 |
|
$contentService->publishVersion($draft->versionInfo); |
| 2912 |
|
|
| 2913 |
|
// This draft contains those fields localized with "eng-GB" |
| 2914 |
|
$draftLocalized = $contentService->loadContentByRemoteId( |
| 2915 |
|
$draft->contentInfo->remoteId, |
| 2916 |
|
array('eng-GB'), |
| 2917 |
|
null, |
| 2918 |
|
false |
| 2919 |
|
); |
| 2920 |
|
/* END: Use Case */ |
| 2921 |
|
|
| 2922 |
|
$this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
| 2923 |
|
} |
| 2924 |
|
|
| 2925 |
|
/** |
| 2926 |
|
* Test for the loadContentByRemoteId() method. |