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

testCreateRole() public method

Test creating a role.
public testCreateRole ( )
    public function testCreateRole()
    {
        $roleService = $this->repository->getRoleService();
        $roleCreateStruct = $roleService->newRoleCreateStruct('ultimate_permissions');
        // @todo uncomment when support for multilingual names and descriptions is added EZP-24776
        // $roleCreateStruct->mainLanguageCode = 'eng-GB';
        // $roleCreateStruct->names = array( 'eng-GB' => 'Ultimate permissions' );
        // $roleCreateStruct->descriptions = array( 'eng-GB' => 'This is a role with ultimate permissions' );
        $createdRole = $roleService->createRole($roleCreateStruct);
        self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\Role', $createdRole);
        self::assertGreaterThan(0, $createdRole->id);
        /* @todo uncomment when support for multilingual names and descriptions is added EZP-24776
                self::assertEquals(
                    array(
                        'eng-GB' => $roleCreateStruct->names['eng-GB']
                    ),
                    $createdRole->getNames()
                );
        
                self::assertEquals(
                    array(
                        'eng-GB' => $roleCreateStruct->descriptions['eng-GB']
                    ),
                    $createdRole->getDescriptions()
                );
                */
        $this->assertPropertiesCorrect(array('identifier' => $roleCreateStruct->identifier, 'policies' => array()), $createdRole);
    }