/** * 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); if ($this->_current === false && $this->_ldap->getLastErrorCode() > LDAP\Exception::LDAP_SUCCESS) { throw new LDAP\Exception($this->_ldap, 'getting first entry'); } } }
/** * @group ZF-8259 */ public function testResourceIsAlwaysReturned() { $ldap = new LDAP\LDAP($this->_options); $this->assertNotNull($ldap->getResource()); $this->assertTrue(is_resource($ldap->getResource())); $this->assertEquals(TESTS_ZEND_LDAP_USERNAME, $ldap->getBoundUser()); }