You are here

public function SimpleLdapServerTest::testConnectFail in Simple LDAP 8

@covers ::connect

File

tests/src/Unit/SimpleLdapServerTest.php, line 56
Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapServer

Class

SimpleLdapServerTest
@coversDefaultClass \Drupal\simple_ldap\SimpleLdapServer @group simple_ldap

Namespace

Drupal\Tests\simple_ldap\Unit

Code

public function testConnectFail() {
  $this->ldap
    ->expects($this
    ->exactly(2))
    ->method('connect')
    ->will($this
    ->throwException(new SimpleLdapException('', '')));
  $server = new SimpleLdapServer($this->config_factory, $this->ldap);
  $this
    ->assertFalse($server
    ->connect());
}