Code Duplication    Length = 17-20 lines in 2 locations

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

@@ 2350-2366 (lines=17) @@
2347
     * @covers \eZ\Publish\Core\Repository\ContentService::loadRelations
2348
     * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
2349
     */
2350
    public function testLoadRelationsThrowsUnauthorizedException()
2351
    {
2352
        list($contentDraft, $contentType) = $this->createTestContent();
2353
        $contentService = $this->repository->getContentService();
2354
2355
        $mediaContentInfo = $contentService->loadContentInfoByRemoteId('a6e35cbcb7cd6ae4b691f3eee30cd262');
2356
2357
        $contentService->addRelation(
2358
            $contentDraft->getVersionInfo(),
2359
            $mediaContentInfo
2360
        );
2361
2362
        // Set anonymous as current user
2363
        $this->repository->setCurrentUser($this->getStubbedUser(10));
2364
2365
        $contentService->loadRelations($contentDraft->versionInfo);
2366
    }
2367
2368
    /**
2369
     * Test for the loadReverseRelations() method.
@@ 2467-2486 (lines=20) @@
2464
     * @covers \eZ\Publish\Core\Repository\ContentService::deleteRelation
2465
     * @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
2466
     */
2467
    public function testDeleteRelationThrowsUnauthorizedException()
2468
    {
2469
        list($contentDraft, $contentType) = $this->createTestContent();
2470
        $contentService = $this->repository->getContentService();
2471
2472
        $mediaContentInfo = $contentService->loadContentInfoByRemoteId('a6e35cbcb7cd6ae4b691f3eee30cd262');
2473
2474
        $contentService->addRelation(
2475
            $contentDraft->getVersionInfo(),
2476
            $mediaContentInfo
2477
        );
2478
2479
        // Set anonymous as current user
2480
        $this->repository->setCurrentUser($this->getStubbedUser(10));
2481
2482
        $contentService->deleteRelation(
2483
            $contentDraft->getVersionInfo(),
2484
            $mediaContentInfo
2485
        );
2486
    }
2487
2488
    /**
2489
     * Test for the deleteRelation() method.