Code Duplication    Length = 17-22 lines in 2 locations

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

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