public function SimpleLdapServerTest::testBind in Simple LDAP 8
Test a default call of bind().
@covers ::bind @depends testConnect
File
- tests/
src/ Unit/ SimpleLdapServerTest.php, line 71 - Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapServer
Class
- SimpleLdapServerTest
- @coversDefaultClass \Drupal\simple_ldap\SimpleLdapServer @group simple_ldap
Namespace
Drupal\Tests\simple_ldap\UnitCode
public function testBind() {
$this->config
->expects($this
->exactly(2))
->method('get')
->withConsecutive(array(
'binddn',
), array(
'bindpw',
))
->willReturn('test_cred');
$this->ldap
->expects($this
->exactly(2))
->method('isBound')
->will($this
->onConsecutiveCalls(FALSE, TRUE));
$this->ldap
->expects($this
->once())
->method('ldapBind')
->willReturn(TRUE);
$server = new SimpleLdapServer($this->config_factory, $this->ldap);
$this
->assertTrue($server
->bind());
}