eZ\Publish\Core\Repository\Tests\Service\Integration\RoleBase::testUpdateRole PHP Method

testUpdateRole() public method

Test updating role.
public testUpdateRole ( )
    public function testUpdateRole()
    {
        $roleService = $this->repository->getRoleService();
        $role = $roleService->loadRoleByIdentifier('Anonymous');
        $roleUpdateStruct = $roleService->newRoleUpdateStruct();
        $roleUpdateStruct->identifier = 'Anonymous 2';
        // @todo uncomment when support for multilingual names and descriptions is added EZP-24776
        // $roleUpdateStruct->mainLanguageCode = 'eng-US';
        // $roleUpdateStruct->names['eng-US'] = 'Anonymous 2';
        // $roleUpdateStruct->descriptions['eng-US'] = 'Anonymous 2 role';
        $updatedRole = $roleService->updateRole($role, $roleUpdateStruct);
        self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\Role', $updatedRole);
        // @todo: enable
        /*
                self::assertEquals(
                    array(
                        'eng-US' => $roleUpdateStruct->names['eng-US']
                    ),
                    $updatedRole->getNames()
                );
        
                self::assertEquals(
                    array(
                        'eng-US' => $roleUpdateStruct->descriptions['eng-US']
                    ),
                    $updatedRole->getDescriptions()
                );
        */
        $this->assertPropertiesCorrect(array('id' => $role->id, 'identifier' => $roleUpdateStruct->identifier, 'policies' => $role->getPolicies()), $updatedRole);
    }