Code Duplication    Length = 17-22 lines in 2 locations

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

@@ 2743-2759 (lines=17) @@
2740
     * @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages)
2741
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2742
     */
2743
    public function testLoadContentWithSecondParameter()
2744
    {
2745
        $repository = $this->getRepository();
2746
2747
        $contentService = $repository->getContentService();
2748
2749
        /* BEGIN: Use Case */
2750
        $draft = $this->createMultipleLanguageDraftVersion1();
2751
2752
        // This draft contains those fields localized with "eng-GB"
2753
        $draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false);
2754
        /* END: Use Case */
2755
2756
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2757
2758
        return $draft;
2759
    }
2760
2761
    /**
2762
     * Test for the loadContent() method using undefined translation.
@@ 2836-2857 (lines=22) @@
2833
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages)
2834
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2835
     */
2836
    public function testLoadContentByRemoteIdWithSecondParameter()
2837
    {
2838
        $repository = $this->getRepository();
2839
2840
        $contentService = $repository->getContentService();
2841
2842
        /* BEGIN: Use Case */
2843
        $draft = $this->createMultipleLanguageDraftVersion1();
2844
2845
        $contentService->publishVersion($draft->versionInfo);
2846
2847
        // This draft contains those fields localized with "eng-GB"
2848
        $draftLocalized = $contentService->loadContentByRemoteId(
2849
            $draft->contentInfo->remoteId,
2850
            array('eng-GB'),
2851
            null,
2852
            false
2853
        );
2854
        /* END: Use Case */
2855
2856
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2857
    }
2858
2859
    /**
2860
     * Test for the loadContentByRemoteId() method.