Code Duplication    Length = 17-22 lines in 2 locations

eZ/Publish/API/Repository/Tests/ContentServiceTest.php 2 locations

@@ 2867-2883 (lines=17) @@
2864
     * @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages)
2865
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2866
     */
2867
    public function testLoadContentWithSecondParameter()
2868
    {
2869
        $repository = $this->getRepository();
2870
2871
        $contentService = $repository->getContentService();
2872
2873
        /* BEGIN: Use Case */
2874
        $draft = $this->createMultipleLanguageDraftVersion1();
2875
2876
        // This draft contains those fields localized with "eng-GB"
2877
        $draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false);
2878
        /* END: Use Case */
2879
2880
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2881
2882
        return $draft;
2883
    }
2884
2885
    /**
2886
     * Test for the loadContent() method using undefined translation.
@@ 2960-2981 (lines=22) @@
2957
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages)
2958
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2959
     */
2960
    public function testLoadContentByRemoteIdWithSecondParameter()
2961
    {
2962
        $repository = $this->getRepository();
2963
2964
        $contentService = $repository->getContentService();
2965
2966
        /* BEGIN: Use Case */
2967
        $draft = $this->createMultipleLanguageDraftVersion1();
2968
2969
        $contentService->publishVersion($draft->versionInfo);
2970
2971
        // This draft contains those fields localized with "eng-GB"
2972
        $draftLocalized = $contentService->loadContentByRemoteId(
2973
            $draft->contentInfo->remoteId,
2974
            array('eng-GB'),
2975
            null,
2976
            false
2977
        );
2978
        /* END: Use Case */
2979
2980
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2981
    }
2982
2983
    /**
2984
     * Test for the loadContentByRemoteId() method.