Code Duplication    Length = 17-22 lines in 2 locations

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

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