Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 2202-2217 (lines=16) @@
2199
     * @see \eZ\Publish\API\Repository\RoleService::unassignRoleFromUser()
2200
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
2201
     */
2202
    public function testUnassignRoleFromUserThrowsInvalidArgumentException()
2203
    {
2204
        $repository = $this->getRepository();
2205
        $roleService = $repository->getRoleService();
2206
2207
        /* BEGIN: Use Case */
2208
        $user = $this->createUserVersion1();
2209
2210
        // Load the existing "Member" role
2211
        $role = $roleService->loadRoleByIdentifier('Member');
2212
2213
        // This call will fail with a "InvalidArgumentException", because the
2214
        // user does not have the "Member" role.
2215
        $roleService->unassignRoleFromUser($role, $user);
2216
        /* END: Use Case */
2217
    }
2218
2219
    /**
2220
     * Test for the getRoleAssignmentsForUser() method.
@@ 2623-2638 (lines=16) @@
2620
     * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
2621
     * @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testUnassignRoleFromUserGroup
2622
     */
2623
    public function testUnassignRoleFromUserGroupThrowsInvalidArgumentException()
2624
    {
2625
        $repository = $this->getRepository();
2626
        $roleService = $repository->getRoleService();
2627
2628
        /* BEGIN: Use Case */
2629
        $userGroup = $this->createUserGroupVersion1();
2630
2631
        // Load the existing "Member" role
2632
        $role = $roleService->loadRoleByIdentifier('Member');
2633
2634
        // This call will fail with a "InvalidArgumentException", because the
2635
        // user group does not have the "Member" role.
2636
        $roleService->unassignRoleFromUserGroup($role, $userGroup);
2637
        /* END: Use Case */
2638
    }
2639
2640
    /**
2641
     * Test unassigning role by assignment.