Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 2232-2247 (lines=16) @@
2229
     * @see \eZ\Publish\API\Repository\RoleService::unassignRoleFromUser()
2230
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
2231
     */
2232
    public function testUnassignRoleFromUserThrowsInvalidArgumentException()
2233
    {
2234
        $repository = $this->getRepository();
2235
        $roleService = $repository->getRoleService();
2236
2237
        /* BEGIN: Use Case */
2238
        $user = $this->createUserVersion1();
2239
2240
        // Load the existing "Member" role
2241
        $role = $roleService->loadRoleByIdentifier('Member');
2242
2243
        // This call will fail with a "InvalidArgumentException", because the
2244
        // user does not have the "Member" role.
2245
        $roleService->unassignRoleFromUser($role, $user);
2246
        /* END: Use Case */
2247
    }
2248
2249
    /**
2250
     * Test for the getRoleAssignmentsForUser() method.
@@ 2688-2703 (lines=16) @@
2685
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
2686
     * @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testUnassignRoleFromUserGroup
2687
     */
2688
    public function testUnassignRoleFromUserGroupThrowsInvalidArgumentException()
2689
    {
2690
        $repository = $this->getRepository();
2691
        $roleService = $repository->getRoleService();
2692
2693
        /* BEGIN: Use Case */
2694
        $userGroup = $this->createUserGroupVersion1();
2695
2696
        // Load the existing "Member" role
2697
        $role = $roleService->loadRoleByIdentifier('Member');
2698
2699
        // This call will fail with a "InvalidArgumentException", because the
2700
        // user group does not have the "Member" role.
2701
        $roleService->unassignRoleFromUserGroup($role, $userGroup);
2702
        /* END: Use Case */
2703
    }
2704
2705
    /**
2706
     * Test unassigning role by assignment.