Code Duplication    Length = 17-22 lines in 2 locations

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

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