Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 2133-2148 (lines=16) @@
2130
     * @see \eZ\Publish\API\Repository\RoleService::unassignRoleFromUser()
2131
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
2132
     */
2133
    public function testUnassignRoleFromUserThrowsInvalidArgumentException()
2134
    {
2135
        $repository = $this->getRepository();
2136
        $roleService = $repository->getRoleService();
2137
2138
        /* BEGIN: Use Case */
2139
        $user = $this->createUserVersion1();
2140
2141
        // Load the existing "Member" role
2142
        $role = $roleService->loadRoleByIdentifier('Member');
2143
2144
        // This call will fail with a "InvalidArgumentException", because the
2145
        // user does not have the "Member" role.
2146
        $roleService->unassignRoleFromUser($role, $user);
2147
        /* END: Use Case */
2148
    }
2149
2150
    /**
2151
     * Test for the getRoleAssignmentsForUser() method.
@@ 2554-2569 (lines=16) @@
2551
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
2552
     * @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testUnassignRoleFromUserGroup
2553
     */
2554
    public function testUnassignRoleFromUserGroupThrowsInvalidArgumentException()
2555
    {
2556
        $repository = $this->getRepository();
2557
        $roleService = $repository->getRoleService();
2558
2559
        /* BEGIN: Use Case */
2560
        $userGroup = $this->createUserGroupVersion1();
2561
2562
        // Load the existing "Member" role
2563
        $role = $roleService->loadRoleByIdentifier('Member');
2564
2565
        // This call will fail with a "InvalidArgumentException", because the
2566
        // user group does not have the "Member" role.
2567
        $roleService->unassignRoleFromUserGroup($role, $userGroup);
2568
        /* END: Use Case */
2569
    }
2570
2571
    /**
2572
     * Test unassigning role by assignment.