/**
  * 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);
 }
Пример #2
0
 /**
  * Authenticates the subject.
  * 
  * @param mixed $token The token to authenticate  
  *
  * @access public
  * @return void
  */
 public function authenticate($token)
 {
     $authService = new RemoteAuthenticationService();
     return $authService->authenticate($token); 
 }