You are here

public function SimpleLdapUserManagerTest::testGetLdapUserNotFound in Simple LDAP 8

@covers ::getLdapUser

File

modules/simple_ldap_user/tests/src/Unit/SimpleLdapUserManagerTest.php, line 92
Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapUserManagerTest

Class

SimpleLdapUserManagerTest
@coversDefaultClass \Drupal\simple_ldap_user\SimpleLdapUserManager @group simple_ldap

Namespace

Drupal\Tests\simple_ldap\Unit

Code

public function testGetLdapUserNotFound() {
  $this
    ->setUpGetLdapUserTests();
  $this->server
    ->expects($this
    ->exactly(2))
    ->method('search')
    ->willReturn(array());
  $user_manager = new SimpleLdapUserManager($this->server, $this->config_factory, $this->query_factory, $this->entity_manager);
  $user = $user_manager
    ->getLdapUser('johnsmith');
  $this
    ->assertFalse($user);
}