Skip to content

Commit

Permalink
do not fail terribly on teardown when ldap could not be set up
Browse files Browse the repository at this point in the history
  • Loading branch information
falkenhawk committed Feb 19, 2023
1 parent 4d4b74c commit 050c989
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Zend/Ldap/CopyRenameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ protected function setUp()

protected function tearDown()
{
if (!$this->_getLdap()) return;

if ($this->_getLdap()->exists($this->_newDn))
$this->_getLdap()->delete($this->_newDn, false);
if ($this->_getLdap()->exists($this->_orgDn))
Expand Down
2 changes: 2 additions & 0 deletions tests/Zend/Ldap/Node/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ protected function setUp()

protected function tearDown()
{
if(!$this->_getLdap()) return;

foreach ($this->_getLdap()->getBaseNode()->searchChildren('objectClass=*') as $child) {
$this->_getLdap()->delete($child->getDn(), true);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Zend/Ldap/OnlineTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ protected function _prepareLdapServer()

protected function _cleanupLdapServer()
{
if (!$this->_ldap) return;

$ldap=$this->_ldap->getResource();
foreach (array_reverse($this->_nodes) as $dn => $entry) {
ldap_delete($ldap, $dn);
Expand Down

0 comments on commit 050c989

Please sign in to comment.