Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 2062-2084 (lines=23) @@
2059
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo)
2060
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2061
     */
2062
    public function testLoadVersionInfoWithSecondParameter()
2063
    {
2064
        $repository = $this->getRepository();
2065
2066
        $contentService = $repository->getContentService();
2067
2068
        /* BEGIN: Use Case */
2069
        $publishedContent = $this->createContentVersion1();
2070
2071
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2072
2073
        // Will return the VersionInfo of the $draftContent
2074
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2075
        /* END: Use Case */
2076
2077
        $this->assertEquals(2, $versionInfo->versionNo);
2078
2079
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2080
        $this->assertEquals(
2081
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2082
            $versionInfo->getContentInfo()->mainLocationId
2083
        );
2084
    }
2085
2086
    /**
2087
     * Test for the loadVersionInfo() method.
@@ 2114-2136 (lines=23) @@
2111
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById($contentId, $versionNo)
2112
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfoWithSecondParameter
2113
     */
2114
    public function testLoadVersionInfoByIdWithSecondParameter()
2115
    {
2116
        $repository = $this->getRepository();
2117
2118
        $contentService = $repository->getContentService();
2119
2120
        /* BEGIN: Use Case */
2121
        $publishedContent = $this->createContentVersion1();
2122
2123
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2124
2125
        // Will return the VersionInfo of the $draftContent
2126
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2127
        /* END: Use Case */
2128
2129
        $this->assertEquals(2, $versionInfo->versionNo);
2130
2131
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2132
        $this->assertEquals(
2133
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2134
            $versionInfo->getContentInfo()->mainLocationId
2135
        );
2136
    }
2137
2138
    /**
2139
     * Test for the loadVersionInfoById() method.