LdapTools\DomainConfiguration::setBaseDn PHP Method

setBaseDn() public method

The base distinguished name to use (ie. "dc=example,dc=com").
public setBaseDn ( string $baseDn )
$baseDn string
    public function setBaseDn($baseDn)
    {
        $this->config['baseDn'] = $baseDn;
        return $this;
    }

Usage Example

 function let(\LdapTools\Connection\LdapConnectionInterface $connection)
 {
     $config = new DomainConfiguration('foo.bar');
     $config->setBaseDn('dc=foo,dc=bar');
     $connection->getConfig()->willReturn($config);
     $options = ['uacMap' => ['disabled' => '2', 'enabled' => '2', 'passwordNeverExpires' => '65536', 'smartCardRequired' => '262144', 'trustedForAllDelegation' => '262144', 'trustedForAnyAuthDelegation' => '16777216', 'passwordIsReversible' => '128'], 'defaultValue' => '512', 'invert' => ['enabled']];
     $this->setOptions($options);
     $this->setLdapConnection($connection);
     $this->setDn('cn=foo,dc=foo,dc=bar');
     $this->expectedOp = function ($operation) {
         return $operation->getFilter() == '(&(objectClass=*))' && $operation->getAttributes() == ['userAccountControl'] && $operation->getBaseDn() == 'cn=foo,dc=foo,dc=bar';
     };
 }