Code Duplication    Length = 16-16 lines in 2 locations

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

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