function it_should_authenticate_a_user($connection)
{
$operation = (new AuthenticationOperation())->setUsername('foo')->setPassword('bar');
$connection->connect('foo', 'bar', false, null)->willReturn($connection);
$connection->isBound()->willReturn(true);
$connection->close()->willReturn($connection);
$connection->connect()->willReturn($connection);
$this->execute($operation)->shouldReturnAnInstanceOf('\\LdapTools\\Operation\\AuthenticationResponse');
$this->execute($operation)->isAuthenticated()->shouldBeEqualTo(true);
}