Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 2117-2139 (lines=23) @@
2114
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo)
2115
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2116
     */
2117
    public function testLoadVersionInfoWithSecondParameter()
2118
    {
2119
        $repository = $this->getRepository();
2120
2121
        $contentService = $repository->getContentService();
2122
2123
        /* BEGIN: Use Case */
2124
        $publishedContent = $this->createContentVersion1();
2125
2126
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2127
2128
        // Will return the VersionInfo of the $draftContent
2129
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2130
        /* END: Use Case */
2131
2132
        $this->assertEquals(2, $versionInfo->versionNo);
2133
2134
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2135
        $this->assertEquals(
2136
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2137
            $versionInfo->getContentInfo()->mainLocationId
2138
        );
2139
    }
2140
2141
    /**
2142
     * Test for the loadVersionInfo() method.
@@ 2169-2191 (lines=23) @@
2166
     * @see \eZ\Publish\API\Repository\ContentService::loadVersionInfoById($contentId, $versionNo)
2167
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadVersionInfoWithSecondParameter
2168
     */
2169
    public function testLoadVersionInfoByIdWithSecondParameter()
2170
    {
2171
        $repository = $this->getRepository();
2172
2173
        $contentService = $repository->getContentService();
2174
2175
        /* BEGIN: Use Case */
2176
        $publishedContent = $this->createContentVersion1();
2177
2178
        $draftContent = $contentService->createContentDraft($publishedContent->contentInfo);
2179
2180
        // Will return the VersionInfo of the $draftContent
2181
        $versionInfo = $contentService->loadVersionInfoById($publishedContent->id, 2);
2182
        /* END: Use Case */
2183
2184
        $this->assertEquals(2, $versionInfo->versionNo);
2185
2186
        // Check that ContentInfo contained in VersionInfo has correct main Location id set
2187
        $this->assertEquals(
2188
            $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId,
2189
            $versionInfo->getContentInfo()->mainLocationId
2190
        );
2191
    }
2192
2193
    /**
2194
     * Test for the loadVersionInfoById() method.