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 (LDAP\Exception $zle) { $this->assertContains('Invalid credentials', $zle->getMessage()); } } }