LdapTools\Configuration::setDefaultDomain PHP Method

setDefaultDomain() public method

Set the default domain that should be used by the LdapManager. In the absence of multiple domains, this does not have to be set.
public setDefaultDomain ( $domain )
$domain
    public function setDefaultDomain($domain)
    {
        $this->config['defaultDomain'] = $domain;
        return $this;
    }

Usage Example

Example #1
0
 function it_should_honor_the_default_domain_configuration_option()
 {
     $config = new Configuration();
     $domain = new DomainConfiguration('example.com');
     $domain->setServers(['example'])->setLazyBind(true)->setBaseDn('dc=example,dc=com');
     $anotherDomain = new DomainConfiguration('test.com');
     $anotherDomain->setServers(['test'])->setLazyBind(true)->setBaseDn('dc=test,dc=com');
     $config->addDomain($domain, $anotherDomain);
     $config->setDefaultDomain('test.com');
     $this->beConstructedWith($config);
     $this->getDomainContext()->shouldBeEqualTo('test.com');
 }