public function test_auth_fails_when_user_found()
{
$user = $this->getMockUser(['cn' => '', 'mail' => '[email protected]', 'samaccountname' => 'jdoe']);
$connection = $this->getMockConnection(['getLastError', 'errNo']);
$connection->expects($this->exactly(1))->method('isBound')->willReturn(true);
$connection->expects($this->exactly(1))->method('search')->willReturn('resource');
$connection->expects($this->exactly(1))->method('getEntries')->willReturn(['count' => 1, $user->getAttributes()]);
$connection->expects($this->exactly(1))->method('getLastError')->willReturn('Bind Failure.');
$connection->expects($this->exactly(1))->method('errNo')->willReturn(1);
$connection->expects($this->exactly(1))->method('bind')->with($this->equalTo('jdoe'))->willReturn(false);
$this->assertFalse(Auth::attempt(['email' => '[email protected]', 'password' => '12345']));
}