Code Duplication    Length = 17-22 lines in 2 locations

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

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