Code Duplication    Length = 17-22 lines in 2 locations

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

@@ 2913-2929 (lines=17) @@
2910
     * @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages)
2911
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2912
     */
2913
    public function testLoadContentWithSecondParameter()
2914
    {
2915
        $repository = $this->getRepository();
2916
2917
        $contentService = $repository->getContentService();
2918
2919
        /* BEGIN: Use Case */
2920
        $draft = $this->createMultipleLanguageDraftVersion1();
2921
2922
        // This draft contains those fields localized with "eng-GB"
2923
        $draftLocalized = $contentService->loadContent($draft->id, ['eng-GB'], null, false);
2924
        /* END: Use Case */
2925
2926
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2927
2928
        return $draft;
2929
    }
2930
2931
    /**
2932
     * Test for the loadContent() method using undefined translation.
@@ 3006-3027 (lines=22) @@
3003
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages)
3004
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
3005
     */
3006
    public function testLoadContentByRemoteIdWithSecondParameter()
3007
    {
3008
        $repository = $this->getRepository();
3009
3010
        $contentService = $repository->getContentService();
3011
3012
        /* BEGIN: Use Case */
3013
        $draft = $this->createMultipleLanguageDraftVersion1();
3014
3015
        $contentService->publishVersion($draft->versionInfo);
3016
3017
        // This draft contains those fields localized with "eng-GB"
3018
        $draftLocalized = $contentService->loadContentByRemoteId(
3019
            $draft->contentInfo->remoteId,
3020
            ['eng-GB'],
3021
            null,
3022
            false
3023
        );
3024
        /* END: Use Case */
3025
3026
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
3027
    }
3028
3029
    /**
3030
     * Test for the loadContentByRemoteId() method.