Code Duplication    Length = 17-20 lines in 2 locations

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

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