protected function _cleanupLdapServer() { $ldap = $this->_ldap->getResource(); foreach (array_reverse($this->_nodes) as $dn => $entry) { ldap_delete($ldap, $dn); } }
protected function _cleanupLDAPServer() { if (!constant('TESTS_ZEND_LDAP_ONLINE_ENABLED')) { return; } $ldap = $this->_ldap->getResource(); foreach (array_reverse($this->_nodes) as $dn => $entry) { ldap_delete($ldap, $dn); } }
/** * Rewind the Iterator to the first result item * Implements Iterator * * @throws Zend_Ldap_Exception */ public function rewind() { if (is_resource($this->_resultId)) { $this->_current = @ldap_first_entry($this->_ldap->getResource(), $this->_resultId); /** @see Zend_Ldap_Exception */ if ($this->_current === false && $this->_ldap->getLastErrorCode() > Zend_Ldap_Exception::LDAP_SUCCESS) { throw new Zend_Ldap_Exception($this->_ldap, 'getting first entry'); } } }
/** * Stores the current DN * * @return void * @throws Zend_Ldap_Exception */ protected function _storeCurrentDn() { if (is_resource($this->_current)) { $this->_currentDn = @ldap_get_dn($this->_ldap->getResource(), $this->_current); if ($this->_currentDn === false) { throw new Zend_Ldap_Exception($this->_ldap, 'getting dn'); } } else { $this->_currentDn = null; } }
/** * @group ZF-8259 */ public function testResourceIsAlwaysReturned() { $ldap = new Zend_Ldap($this->_options); $this->assertNotNull($ldap->getResource()); $this->assertTrue(is_resource($ldap->getResource())); $this->assertEquals(TESTS_ZEND_LDAP_USERNAME, $ldap->getBoundUser()); }