public function testUserAuthenticationFailure() { self::$functions->expects($this->once())->method('ldap_connect')->with($this->equalTo('my_ldap_server'), $this->equalTo(389))->will($this->returnValue('my_ldap_resource')); self::$functions->expects($this->once())->method('ldap_bind')->with($this->equalTo('my_ldap_resource'), $this->equalTo('my_ldap_user'), $this->equalTo('my_ldap_password'))->will($this->returnValue(false)); $this->setExpectedException('\\Kanboard\\Core\\Ldap\\ClientException'); $ldap = new Client(); $ldap->open('my_ldap_server'); $ldap->authenticate('my_ldap_user', 'my_ldap_password'); }