Code Duplication    Length = 17-22 lines in 2 locations

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

@@ 2905-2921 (lines=17) @@
2902
     * @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages)
2903
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2904
     */
2905
    public function testLoadContentWithSecondParameter()
2906
    {
2907
        $repository = $this->getRepository();
2908
2909
        $contentService = $repository->getContentService();
2910
2911
        /* BEGIN: Use Case */
2912
        $draft = $this->createMultipleLanguageDraftVersion1();
2913
2914
        // This draft contains those fields localized with "eng-GB"
2915
        $draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false);
2916
        /* END: Use Case */
2917
2918
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2919
2920
        return $draft;
2921
    }
2922
2923
    /**
2924
     * Test for the loadContent() method using undefined translation.
@@ 2998-3019 (lines=22) @@
2995
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages)
2996
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2997
     */
2998
    public function testLoadContentByRemoteIdWithSecondParameter()
2999
    {
3000
        $repository = $this->getRepository();
3001
3002
        $contentService = $repository->getContentService();
3003
3004
        /* BEGIN: Use Case */
3005
        $draft = $this->createMultipleLanguageDraftVersion1();
3006
3007
        $contentService->publishVersion($draft->versionInfo);
3008
3009
        // This draft contains those fields localized with "eng-GB"
3010
        $draftLocalized = $contentService->loadContentByRemoteId(
3011
            $draft->contentInfo->remoteId,
3012
            array('eng-GB'),
3013
            null,
3014
            false
3015
        );
3016
        /* END: Use Case */
3017
3018
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
3019
    }
3020
3021
    /**
3022
     * Test for the loadContentByRemoteId() method.