Code Duplication    Length = 23-23 lines in 2 locations

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

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