Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'ZF-11946' of https://github.com/sgehrig/zf2 into hotfix…
Browse files Browse the repository at this point in the history
…/zf-11946
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/Collection/DefaultIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function key()
*/
public function next()
{
if (is_resource($this->_current)) {
if (is_resource($this->_current) && $this->_itemCount > 0) {
$this->_current = @ldap_next_entry($this->_ldap->getResource(), $this->_current);
if ($this->_current === false) {
$msg = $this->_ldap->getLastError($code);
Expand All @@ -273,6 +273,8 @@ public function next()
throw new Ldap\Exception($this->_ldap, 'getting next entry (' . $msg . ')');
}
}
} else {
$this->_current = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/OnlineTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class OnlineTestCase extends TestCase
private $_nodes;

/**
* @return Zend_LDAP
* @return \Zend\Ldap\Ldap
*/
protected function _getLDAP()
{
Expand Down
6 changes: 3 additions & 3 deletions test/SearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function testSearchEntriesShortcut()
{
$entries=$this->_getLDAP()->searchEntries('(objectClass=organizationalUnit)',
TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, Ldap\Ldap::SEARCH_SCOPE_SUB);
$this->assertType("array", $entries);
$this->assertInternalType("array", $entries);
$this->assertEquals(9, count($entries));
}

Expand Down Expand Up @@ -232,7 +232,7 @@ public function testSearchEntriesShortcutWithDnObjectAndFilterObject()
$filter=Filter::equals('objectClass', 'organizationalUnit');

$entries=$this->_getLDAP()->searchEntries($filter, $dn, Ldap\Ldap::SEARCH_SCOPE_SUB);
$this->assertType("array", $entries);
$this->assertInternalType("array", $entries);
$this->assertEquals(9, count($entries));
}

Expand Down Expand Up @@ -442,7 +442,7 @@ public function testInnerIteratorIsOfRequiredType()
{
$items = $this->_getLDAP()->search('(objectClass=organizationalUnit)',
TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, Ldap\Ldap::SEARCH_SCOPE_SUB);
$this->assertType('\Zend\Ldap\Collection\DefaultIterator', $items->getInnerIterator());
$this->assertInstanceOf('\Zend\Ldap\Collection\DefaultIterator', $items->getInnerIterator());
}

/**
Expand Down

0 comments on commit 4ae1fe7

Please sign in to comment.