LdapTools\DomainConfiguration::setLdapType PHP Method

setLdapType() public method

Set the LDAP type for this domain.
public setLdapType ( string $ldapType )
$ldapType string The LDAP type.
    public function setLdapType($ldapType)
    {
        if (!defined('\\LdapTools\\Connection\\LdapConnection::TYPE_' . strtoupper($ldapType))) {
            throw new InvalidArgumentException(sprintf('Invalid LDAP type "%s".', $ldapType));
        }
        $this->config['ldapType'] = strtolower($ldapType);
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 function it_should_throw_a_SchemaParserException_when_the_schema_file_is_not_readable()
 {
     $fakePath = '/this/path/should/never/really/exist/I/would/hope';
     $this->beConstructedWith($fakePath);
     $domain = new DomainConfiguration('example.com');
     $domain->setLdapType('ad');
     $this->shouldThrow(new SchemaParserException('Cannot find schema for "ad" in "' . $fakePath . '"'))->duringParse($domain->getLdapType(), 'user');
 }
All Usage Examples Of LdapTools\DomainConfiguration::setLdapType