/**
  * Authenticates the client - uses the client's configured authentication method and authenticates
  * the request.
  * 
  * @param RequestInterface $request
  * @param Client $client
  * @return Result
  */
 public function authenticate(RequestInterface $request, Client $client)
 {
     $clientAuthenticationInfo = $client->getAuthenticationInfo();
     $authenticationMethod = $clientAuthenticationInfo->getMethod();
     $authenticationMethodConfig = $this->getMethodConfig($authenticationMethod);
     $method = $this->getAuthenticationMethodFactory()->createAuthenticationMethod($authenticationMethodConfig);
     // $method = $this->getAuthenticationMethodFactory()->createMethod($clientAuthenticationInfo->getMethod());
     return $method->authenticate($clientAuthenticationInfo, $request->getHttpRequest());
 }
 public function testIncompleteAuthenticationInfoException()
 {
     $this->setExpectedException('InoOicServer\\Client\\Exception\\IncompleteAuthenticationInfoException');
     $client = new Client\Client(array('id' => 'myClientId', 'type' => 'public'));
     $authenticationInfo = $client->getAuthenticationInfo();
 }