Code Duplication    Length = 13-14 lines in 2 locations

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

@@ 561-573 (lines=13) @@
558
     *
559
     * @covers \eZ\Publish\API\Repository\RoleService::loadRoles
560
     */
561
    public function testLoadRoles()
562
    {
563
        $roleService = $this->repository->getRoleService();
564
565
        $roles = $roleService->loadRoles();
566
        self::assertInternalType('array', $roles);
567
        self::assertGreaterThan(0, count($roles));
568
569
        foreach ($roles as $role) {
570
            self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\Role', $role);
571
            self::assertGreaterThan(0, $role->id);
572
        }
573
    }
574
575
    /**
576
     * Test deleting a role.
@@ 602-615 (lines=14) @@
599
     *
600
     * @covers \eZ\Publish\API\Repository\RoleService::loadPoliciesByUserId
601
     */
602
    public function testLoadPoliciesByUserId()
603
    {
604
        $roleService = $this->repository->getRoleService();
605
606
        $policies = $roleService->loadPoliciesByUserId(10);
607
        self::assertInternalType('array', $policies);
608
        self::assertNotEmpty($policies);
609
610
        foreach ($policies as $policy) {
611
            self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\Policy', $policy);
612
            self::assertGreaterThan(0, $policy->id);
613
            self::assertGreaterThan(0, $policy->roleId);
614
        }
615
    }
616
617
    /**
618
     * Test loading policies by non existing user ID.