Code Duplication    Length = 17-22 lines in 2 locations

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

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