function it_should_throw_a_bad_credentials_exception_on_an_invalid_password_with_the_exact_message_if_specified() { $this->beConstructedWith('restricted', false, $this->userProvider, new LdapUserChecker(), $this->ldap, $this->dispatcher); $this->response->isAuthenticated()->willReturn(false); $this->response->getErrorCode()->willReturn(9000); $this->response->getErrorMessage()->willReturn('foo'); $e = new BadCredentialsException('foo', 9000); $this->shouldThrow($e)->duringAuthenticate($this->token); }