|
@@ 2898-2914 (lines=17) @@
|
| 2895 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages) |
| 2896 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2897 |
|
*/ |
| 2898 |
|
public function testLoadContentWithSecondParameter() |
| 2899 |
|
{ |
| 2900 |
|
$repository = $this->getRepository(); |
| 2901 |
|
|
| 2902 |
|
$contentService = $repository->getContentService(); |
| 2903 |
|
|
| 2904 |
|
/* BEGIN: Use Case */ |
| 2905 |
|
$draft = $this->createMultipleLanguageDraftVersion1(); |
| 2906 |
|
|
| 2907 |
|
// This draft contains those fields localized with "eng-GB" |
| 2908 |
|
$draftLocalized = $contentService->loadContent($draft->id, ['eng-GB'], null, false); |
| 2909 |
|
/* END: Use Case */ |
| 2910 |
|
|
| 2911 |
|
$this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
| 2912 |
|
|
| 2913 |
|
return $draft; |
| 2914 |
|
} |
| 2915 |
|
|
| 2916 |
|
/** |
| 2917 |
|
* Test for the loadContent() method using undefined translation. |
|
@@ 2991-3012 (lines=22) @@
|
| 2988 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages) |
| 2989 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2990 |
|
*/ |
| 2991 |
|
public function testLoadContentByRemoteIdWithSecondParameter() |
| 2992 |
|
{ |
| 2993 |
|
$repository = $this->getRepository(); |
| 2994 |
|
|
| 2995 |
|
$contentService = $repository->getContentService(); |
| 2996 |
|
|
| 2997 |
|
/* BEGIN: Use Case */ |
| 2998 |
|
$draft = $this->createMultipleLanguageDraftVersion1(); |
| 2999 |
|
|
| 3000 |
|
$contentService->publishVersion($draft->versionInfo); |
| 3001 |
|
|
| 3002 |
|
// This draft contains those fields localized with "eng-GB" |
| 3003 |
|
$draftLocalized = $contentService->loadContentByRemoteId( |
| 3004 |
|
$draft->contentInfo->remoteId, |
| 3005 |
|
['eng-GB'], |
| 3006 |
|
null, |
| 3007 |
|
false |
| 3008 |
|
); |
| 3009 |
|
/* END: Use Case */ |
| 3010 |
|
|
| 3011 |
|
$this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
| 3012 |
|
} |
| 3013 |
|
|
| 3014 |
|
/** |
| 3015 |
|
* Test for the loadContentByRemoteId() method. |