Code Duplication    Length = 17-22 lines in 2 locations

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

@@ 2715-2731 (lines=17) @@
2712
     * @see \eZ\Publish\API\Repository\ContentService::loadContent($contentId, $languages)
2713
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2714
     */
2715
    public function testLoadContentWithSecondParameter()
2716
    {
2717
        $repository = $this->getRepository();
2718
2719
        $contentService = $repository->getContentService();
2720
2721
        /* BEGIN: Use Case */
2722
        $draft = $this->createMultipleLanguageDraftVersion1();
2723
2724
        // This draft contains those fields localized with "eng-GB"
2725
        $draftLocalized = $contentService->loadContent($draft->id, array('eng-GB'), null, false);
2726
        /* END: Use Case */
2727
2728
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2729
2730
        return $draft;
2731
    }
2732
2733
    /**
2734
     * Test for the loadContent() method using undefined translation.
@@ 2808-2829 (lines=22) @@
2805
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByRemoteId($remoteId, $languages)
2806
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2807
     */
2808
    public function testLoadContentByRemoteIdWithSecondParameter()
2809
    {
2810
        $repository = $this->getRepository();
2811
2812
        $contentService = $repository->getContentService();
2813
2814
        /* BEGIN: Use Case */
2815
        $draft = $this->createMultipleLanguageDraftVersion1();
2816
2817
        $contentService->publishVersion($draft->versionInfo);
2818
2819
        // This draft contains those fields localized with "eng-GB"
2820
        $draftLocalized = $contentService->loadContentByRemoteId(
2821
            $draft->contentInfo->remoteId,
2822
            array('eng-GB'),
2823
            null,
2824
            false
2825
        );
2826
        /* END: Use Case */
2827
2828
        $this->assertLocaleFieldsEquals($draftLocalized->getFields(), 'eng-GB');
2829
    }
2830
2831
    /**
2832
     * Test for the loadContentByRemoteId() method.