/** * Set an Ldap connection * * @param Zend_Ldap $ldap An existing Ldap object * @return Zend_Auth_Adapter_Ldap Provides a fluent interface */ public function setLdap(Zend_Ldap $ldap) { $this->_ldap = $ldap; $this->setOptions(array($ldap->getOptions())); return $this; }
public function testConfigObject() { /** * @see Zend_Config */ require_once 'Zend/Config.php'; $config = new Zend_Config(array('host' => TESTS_ZEND_LDAP_HOST, 'username' => TESTS_ZEND_LDAP_USERNAME, 'password' => TESTS_ZEND_LDAP_PASSWORD, 'baseDn' => TESTS_ZEND_LDAP_BASE_DN)); $ldap = new Zend_Ldap($config); $this->assertEquals(array('host' => TESTS_ZEND_LDAP_HOST, 'port' => 0, 'useSsl' => false, 'username' => TESTS_ZEND_LDAP_USERNAME, 'password' => TESTS_ZEND_LDAP_PASSWORD, 'bindRequiresDn' => false, 'baseDn' => TESTS_ZEND_LDAP_BASE_DN, 'accountCanonicalForm' => null, 'accountDomainName' => null, 'accountDomainNameShort' => null, 'accountFilterFormat' => null, 'allowEmptyPassword' => false, 'useStartTls' => false, 'optReferrals' => false, 'tryUsernameSplit' => true), $ldap->getOptions()); }