Пример #1
0
 protected function _cleanupLdapServer()
 {
     $ldap = $this->_ldap->getResource();
     foreach (array_reverse($this->_nodes) as $dn => $entry) {
         ldap_delete($ldap, $dn);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 /**
  * 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');
         }
     }
 }
Пример #4
0
 /**
  * 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;
     }
 }
Пример #5
0
 /**
  * @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());
 }