public function testBindByDnBadPassword()
 {
     $dn = 'uid=test_username,ou=example,dc=com';
     $password = '******';
     $user = new TestUser();
     $user->setDn($dn);
     $this->zend->expects($this->once())->method('bind')->with($this->equalTo($dn), $this->equalTo($password))->will($this->throwException(new ZendLdapException($this->zend)));
     $this->assertFalse($this->zendLdapDriver->bind($user, $password));
 }
Exemplo n.º 2
0
 /**
  * @covers FR3D\LdapBundle\Ldap\LdapManager::bind
  */
 public function testBind()
 {
     $dn = 'dn=test_username';
     $password = '******';
     $user = new TestUser();
     $user->setDn($dn);
     $this->connection->expects($this->once())->method('bind')->with($this->equalTo($dn), $this->equalTo($password))->will($this->returnValue(true));
     $this->assertTrue($this->ldapManager->bind($user, $password));
 }