Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 1999-2021 (lines=23) @@
1996
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo)
1997
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1998
     */
1999
    public function testLoadVersionInfoWithSecondParameter()
2000
    {
2001
        $repository = $this->getRepository();
2002
2003
        $contentService = $repository->getContentService();
2004
2005
        /* BEGIN: Use Case */
2006
        $publishedContent = $this->createContentVersion1();
2007
2008
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2009
2010
        // Will return the VersionInfo of the $draftContent
2011
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2012
        /* END: Use Case */
2013
2014
        $this->assertEquals(2, $versionInfo->versionNo);
2015
2016
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2017
        $this->assertEquals(
2018
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2019
            $versionInfo->getContentInfo()->mainLocationId
2020
        );
2021
    }
2022
2023
    /**
2024
     * Test for the loadVersionInfo() method.
@@ 2051-2073 (lines=23) @@
2048
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById($contentId, $versionNo)
2049
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfoWithSecondParameter
2050
     */
2051
    public function testLoadVersionInfoByIdWithSecondParameter()
2052
    {
2053
        $repository = $this->getRepository();
2054
2055
        $contentService = $repository->getContentService();
2056
2057
        /* BEGIN: Use Case */
2058
        $publishedContent = $this->createContentVersion1();
2059
2060
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2061
2062
        // Will return the VersionInfo of the $draftContent
2063
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2064
        /* END: Use Case */
2065
2066
        $this->assertEquals(2, $versionInfo->versionNo);
2067
2068
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2069
        $this->assertEquals(
2070
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2071
            $versionInfo->getContentInfo()->mainLocationId
2072
        );
2073
    }
2074
2075
    /**
2076
     * Test for the loadVersionInfoById() method.