Code Duplication    Length = 14-14 lines in 3 locations

eZ/Publish/API/Repository/Tests/RoleServiceTest.php 3 locations

@@ 499-512 (lines=14) @@
496
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
497
     * @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testLoadRole
498
     */
499
    public function testLoadRoleThrowsNotFoundException()
500
    {
501
        $repository = $this->getRepository();
502
503
        $nonExistingRoleId = $this->generateId('role', self::DB_INT_MAX);
504
        /* BEGIN: Use Case */
505
506
        $roleService = $repository->getRoleService();
507
508
        // This call will fail with a NotFoundException, because no such role exists.
509
        $roleService->loadRole($nonExistingRoleId);
510
511
        /* END: Use Case */
512
    }
513
514
    /**
515
     * Test for the loadRoleDraft() method.
@@ 521-534 (lines=14) @@
518
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
519
     * @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testLoadRoleDraft
520
     */
521
    public function testLoadRoleDraftThrowsNotFoundException()
522
    {
523
        $repository = $this->getRepository();
524
525
        $nonExistingRoleId = $this->generateId('role', self::DB_INT_MAX);
526
        /* BEGIN: Use Case */
527
528
        $roleService = $repository->getRoleService();
529
530
        // This call will fail with a NotFoundException, because no such role exists.
531
        $roleService->loadRoleDraft($nonExistingRoleId);
532
533
        /* END: Use Case */
534
    }
535
536
    /**
537
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
@@ 539-552 (lines=14) @@
536
    /**
537
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
538
     */
539
    public function testLoadRoleDraftByRoleIdThrowsNotFoundException()
540
    {
541
        $repository = $this->getRepository();
542
543
        $nonExistingRoleId = $this->generateId('role', self::DB_INT_MAX);
544
        /* BEGIN: Use Case */
545
546
        $roleService = $repository->getRoleService();
547
548
        // This call will fail with a NotFoundException, because no such role exists.
549
        $roleService->loadRoleDraftByRoleId($nonExistingRoleId);
550
551
        /* END: Use Case */
552
    }
553
554
    /**
555
     * Test for the loadRoleByIdentifier() method.