function it_should_attempt_to_authenticate_a_username_and_password(LdapConnectionInterface $connection) { $operation = new AuthenticationOperation(); $operation->setUsername('foo')->setPassword('bar'); $response = new AuthenticationResponse(true); $domainConfig = new DomainConfiguration('example.local'); $connection->getConfig()->willReturn($domainConfig); $connection->execute($operation)->willReturn($response); $this->beConstructedWith(new Configuration(), $connection); $this->authenticate('foo', 'bar')->shouldBeEqualTo(true); }