protected function tearDown() { if ($this->ldap !== null) { $this->ldap->disconnect(); $this->ldap = null; } }
public function testDisconnect() { $ldap = new Ldap\Ldap($this->options); for ($i = 0; $i < 3; $i++) { $ldap->disconnect(); try { $ldap->connect()->bind('CN=ignored,DC=example,DC=com', 'ignored'); $this->fail('Expected exception for unknown username'); } catch (Exception\LdapException $zle) { $this->assertContains('Invalid credentials', $zle->getMessage()); } } }