Code Duplication    Length = 17-22 lines in 2 locations

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

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