Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 2070-2092 (lines=23) @@
2067
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo)
2068
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2069
     */
2070
    public function testLoadVersionInfoWithSecondParameter()
2071
    {
2072
        $repository = $this->getRepository();
2073
2074
        $contentService = $repository->getContentService();
2075
2076
        /* BEGIN: Use Case */
2077
        $publishedContent = $this->createContentVersion1();
2078
2079
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2080
2081
        // Will return the VersionInfo of the $draftContent
2082
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2083
        /* END: Use Case */
2084
2085
        $this->assertEquals(2, $versionInfo->versionNo);
2086
2087
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2088
        $this->assertEquals(
2089
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2090
            $versionInfo->getContentInfo()->mainLocationId
2091
        );
2092
    }
2093
2094
    /**
2095
     * Test for the loadVersionInfo() method.
@@ 2122-2144 (lines=23) @@
2119
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById($contentId, $versionNo)
2120
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfoWithSecondParameter
2121
     */
2122
    public function testLoadVersionInfoByIdWithSecondParameter()
2123
    {
2124
        $repository = $this->getRepository();
2125
2126
        $contentService = $repository->getContentService();
2127
2128
        /* BEGIN: Use Case */
2129
        $publishedContent = $this->createContentVersion1();
2130
2131
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2132
2133
        // Will return the VersionInfo of the $draftContent
2134
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2135
        /* END: Use Case */
2136
2137
        $this->assertEquals(2, $versionInfo->versionNo);
2138
2139
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2140
        $this->assertEquals(
2141
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2142
            $versionInfo->getContentInfo()->mainLocationId
2143
        );
2144
    }
2145
2146
    /**
2147
     * Test for the loadVersionInfoById() method.