Code coverage improvements in grant classes

This commit is contained in:
Alex Bilbie
2014-11-23 23:32:50 +00:00
parent 6157bd77ca
commit e1c0ff2685
4 changed files with 20 additions and 40 deletions

View File

@@ -55,20 +55,15 @@ class ClientCredentialsGrant extends AbstractGrant
public function completeFlow()
{
// Get the required params
$clientId = $this->server->getRequest()->request->get('client_id', null);
$clientId = $this->server->getRequest()->request->get('client_id', $this->server->getRequest()->getUser());
if (is_null($clientId)) {
$clientId = $this->server->getRequest()->getUser();
if (is_null($clientId)) {
throw new Exception\InvalidRequestException('client_id');
}
throw new Exception\InvalidRequestException('client_id');
}
$clientSecret = $this->server->getRequest()->request->get('client_secret', null);
$clientSecret = $this->server->getRequest()->request->get('client_secret',
$this->server->getRequest()->getPassword());
if (is_null($clientSecret)) {
$clientSecret = $this->server->getRequest()->getPassword();
if (is_null($clientSecret)) {
throw new Exception\InvalidRequestException('client_secret');
}
throw new Exception\InvalidRequestException('client_secret');
}
// Validate client ID and client secret