Code Duplication    Length = 13-14 lines in 2 locations

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

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