Code Duplication    Length = 13-14 lines in 2 locations

eZ/Publish/Core/Repository/Tests/Service/Integration/ContentBase.php 2 locations

@@ 2052-2065 (lines=14) @@
2049
     * @covers \eZ\Publish\Core\Repository\ContentService::deleteVersion
2050
     * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
2051
     */
2052
    public function testDeleteVersionThrowsUnauthorizedException()
2053
    {
2054
        $contentService = $this->repository->getContentService();
2055
2056
        $contentInfo = $contentService->loadContentInfo(4);
2057
2058
        // Create a version to delete
2059
        $draftContent = $contentService->createContentDraft($contentInfo);
2060
2061
        // Set anonymous as current user
2062
        $this->repository->setCurrentUser($this->getStubbedUser(10));
2063
2064
        $contentService->deleteVersion($draftContent->versionInfo);
2065
    }
2066
2067
    /**
2068
     * Test for the copyContent() method.
@@ 2249-2261 (lines=13) @@
2246
     * @covers \eZ\Publish\Core\Repository\ContentService::copyContent
2247
     * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
2248
     */
2249
    public function testCopyContentThrowsUnauthorizedException()
2250
    {
2251
        $contentService = $this->repository->getContentService();
2252
        $locationService = $this->repository->getLocationService();
2253
2254
        $contentInfo = $contentService->loadContentInfo(11);
2255
        $destinationLocationCreateStruct = $locationService->newLocationCreateStruct(5);
2256
2257
        // Set anonymous as current user
2258
        $this->repository->setCurrentUser($this->getStubbedUser(10));
2259
2260
        $contentService->copyContent($contentInfo, $destinationLocationCreateStruct);
2261
    }
2262
2263
    /**
2264
     * Test for the newTranslationInfo() method.