|
@@ 2929-2945 (lines=17) @@
|
| 2926 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages) |
| 2927 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2928 |
|
*/ |
| 2929 |
|
public function testLoadContentWithSecondParameter() |
| 2930 |
|
{ |
| 2931 |
|
$repository = $this->getRepository(); |
| 2932 |
|
|
| 2933 |
|
$contentService = $repository->getContentService(); |
| 2934 |
|
|
| 2935 |
|
/* BEGIN: Use Case */ |
| 2936 |
|
$draft = $this->createMultipleLanguageDraftVersion1(); |
| 2937 |
|
|
| 2938 |
|
// This draft contains those fields localized with "eng-GB" |
| 2939 |
|
$draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false); |
| 2940 |
|
/* END: Use Case */ |
| 2941 |
|
|
| 2942 |
|
$this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
| 2943 |
|
|
| 2944 |
|
return $draft; |
| 2945 |
|
} |
| 2946 |
|
|
| 2947 |
|
/** |
| 2948 |
|
* Test for the loadContent() method using undefined translation. |
|
@@ 3024-3045 (lines=22) @@
|
| 3021 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages) |
| 3022 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 3023 |
|
*/ |
| 3024 |
|
public function testLoadContentByRemoteIdWithSecondParameter() |
| 3025 |
|
{ |
| 3026 |
|
$repository = $this->getRepository(); |
| 3027 |
|
|
| 3028 |
|
$contentService = $repository->getContentService(); |
| 3029 |
|
|
| 3030 |
|
/* BEGIN: Use Case */ |
| 3031 |
|
$draft = $this->createMultipleLanguageDraftVersion1(); |
| 3032 |
|
|
| 3033 |
|
$contentService->publishVersion($draft->versionInfo); |
| 3034 |
|
|
| 3035 |
|
// This draft contains those fields localized with "eng-GB" |
| 3036 |
|
$draftLocalized = $contentService->loadContentByRemoteId( |
| 3037 |
|
$draft->contentInfo->remoteId, |
| 3038 |
|
array('eng-GB'), |
| 3039 |
|
null, |
| 3040 |
|
false |
| 3041 |
|
); |
| 3042 |
|
/* END: Use Case */ |
| 3043 |
|
|
| 3044 |
|
$this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
| 3045 |
|
} |
| 3046 |
|
|
| 3047 |
|
/** |
| 3048 |
|
* Test for the loadContentByRemoteId() method. |