/** * testAuthFailure * * @expectedException Native5\Identity\AuthenticationException */ public function testAuthFailure() { $resp = new \Guzzle\Http\Message\Response("200", array('Content-Type' => 'application/json'), '{"displayName":"barry", "email":"*****@*****.**", "account":"ACC_01010"}'); $mockClient = $this->getMock('Guzzle\\Http\\Client', array('send')); $authService = new RemoteAuthenticationService(); $authService->setRemoteClient($this->_mockClient); $this->_mockClient->expects($this->once())->method('send')->will($this->throwException(new \Exception())); $token = new UsernamePasswordToken('*****@*****.**', 'Awq21sdfjqe2'); $authInfo = $authService->authenticate($token); }