Code Duplication    Length = 17-22 lines in 2 locations

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

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