Code Duplication    Length = 17-22 lines in 2 locations

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

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