Code Duplication    Length = 18-21 lines in 3 locations

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

@@ 651-668 (lines=18) @@
648
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentInfo
649
     * @group user
650
     */
651
    public function testLoadVersionInfo()
652
    {
653
        $mediaFolderId = $this->generateId('object', 41);
654
        /* BEGIN: Use Case */
655
        // $mediaFolderId contains the ID of the "Media" folder
656
657
        // Load the ContentInfo for "Media" folder
658
        $contentInfo = $this->contentService->loadContentInfo($mediaFolderId);
659
660
        // Now load the current version info of the "Media" folder
661
        $versionInfo = $this->contentService->loadVersionInfo($contentInfo);
662
        /* END: Use Case */
663
664
        $this->assertInstanceOf(
665
            VersionInfo::class,
666
            $versionInfo
667
        );
668
    }
669
670
    /**
671
     * Test for the loadVersionInfoById() method.
@@ 750-767 (lines=18) @@
747
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByContentInfo()
748
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentInfo
749
     */
750
    public function testLoadContentByContentInfo()
751
    {
752
        $mediaFolderId = $this->generateId('object', 41);
753
        /* BEGIN: Use Case */
754
        // $mediaFolderId contains the ID of the "Media" folder
755
756
        // Load the ContentInfo for "Media" folder
757
        $contentInfo = $this->contentService->loadContentInfo($mediaFolderId);
758
759
        // Now load the current content version for the info instance
760
        $content = $this->contentService->loadContentByContentInfo($contentInfo);
761
        /* END: Use Case */
762
763
        $this->assertInstanceOf(
764
            Content::class,
765
            $content
766
        );
767
    }
768
769
    /**
770
     * Test for the loadContentByVersionInfo() method.
@@ 775-795 (lines=21) @@
772
     * @see \eZ\Publish\API\Repository\ContentService::loadContentByVersionInfo()
773
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfo
774
     */
775
    public function testLoadContentByVersionInfo()
776
    {
777
        $mediaFolderId = $this->generateId('object', 41);
778
        /* BEGIN: Use Case */
779
        // $mediaFolderId contains the ID of the "Media" folder
780
781
        // Load the ContentInfo for "Media" folder
782
        $contentInfo = $this->contentService->loadContentInfo($mediaFolderId);
783
784
        // Load the current VersionInfo
785
        $versionInfo = $this->contentService->loadVersionInfo($contentInfo);
786
787
        // Now load the current content version for the info instance
788
        $content = $this->contentService->loadContentByVersionInfo($versionInfo);
789
        /* END: Use Case */
790
791
        $this->assertInstanceOf(
792
            Content::class,
793
            $content
794
        );
795
    }
796
797
    /**
798
     * Test for the loadContent() method.