Code Duplication    Length = 17-22 lines in 2 locations

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

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