@@ 2738-2754 (lines=17) @@ | ||
2735 | * @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages) |
|
2736 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
|
2737 | */ |
|
2738 | public function testLoadContentWithSecondParameter() |
|
2739 | { |
|
2740 | $repository = $this->getRepository(); |
|
2741 | ||
2742 | $contentService = $repository->getContentService(); |
|
2743 | ||
2744 | /* BEGIN: Use Case */ |
|
2745 | $draft = $this->createMultipleLanguageDraftVersion1(); |
|
2746 | ||
2747 | // This draft contains those fields localized with "eng-GB" |
|
2748 | $draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false); |
|
2749 | /* END: Use Case */ |
|
2750 | ||
2751 | $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
|
2752 | ||
2753 | return $draft; |
|
2754 | } |
|
2755 | ||
2756 | /** |
|
2757 | * Test for the loadContent() method using undefined translation. |
|
@@ 2831-2852 (lines=22) @@ | ||
2828 | * @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages) |
|
2829 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
|
2830 | */ |
|
2831 | public function testLoadContentByRemoteIdWithSecondParameter() |
|
2832 | { |
|
2833 | $repository = $this->getRepository(); |
|
2834 | ||
2835 | $contentService = $repository->getContentService(); |
|
2836 | ||
2837 | /* BEGIN: Use Case */ |
|
2838 | $draft = $this->createMultipleLanguageDraftVersion1(); |
|
2839 | ||
2840 | $contentService->publishVersion($draft->versionInfo); |
|
2841 | ||
2842 | // This draft contains those fields localized with "eng-GB" |
|
2843 | $draftLocalized = $contentService->loadContentByRemoteId( |
|
2844 | $draft->contentInfo->remoteId, |
|
2845 | array('eng-GB'), |
|
2846 | null, |
|
2847 | false |
|
2848 | ); |
|
2849 | /* END: Use Case */ |
|
2850 | ||
2851 | $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB'); |
|
2852 | } |
|
2853 | ||
2854 | /** |
|
2855 | * Test for the loadContentByRemoteId() method. |