Code Duplication    Length = 17-22 lines in 2 locations

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

@@ 2752-2768 (lines=17) @@
2749
     * @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages)
2750
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2751
     */
2752
    public function testLoadContentWithSecondParameter()
2753
    {
2754
        $repository = $this->getRepository();
2755
2756
        $contentService = $repository->getContentService();
2757
2758
        /* BEGIN: Use Case */
2759
        $draft = $this->createMultipleLanguageDraftVersion1();
2760
2761
        // This draft contains those fields localized with "eng-GB"
2762
        $draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false);
2763
        /* END: Use Case */
2764
2765
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2766
2767
        return $draft;
2768
    }
2769
2770
    /**
2771
     * Test for the loadContent() method using undefined translation.
@@ 2845-2866 (lines=22) @@
2842
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages)
2843
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2844
     */
2845
    public function testLoadContentByRemoteIdWithSecondParameter()
2846
    {
2847
        $repository = $this->getRepository();
2848
2849
        $contentService = $repository->getContentService();
2850
2851
        /* BEGIN: Use Case */
2852
        $draft = $this->createMultipleLanguageDraftVersion1();
2853
2854
        $contentService->publishVersion($draft->versionInfo);
2855
2856
        // This draft contains those fields localized with "eng-GB"
2857
        $draftLocalized = $contentService->loadContentByRemoteId(
2858
            $draft->contentInfo->remoteId,
2859
            array('eng-GB'),
2860
            null,
2861
            false
2862
        );
2863
        /* END: Use Case */
2864
2865
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2866
    }
2867
2868
    /**
2869
     * Test for the loadContentByRemoteId() method.