Fixes and tests

This commit is contained in:
Alex Bilbie
2014-12-27 22:26:31 +00:00
parent c56562b0b8
commit 707c85b0d6
3 changed files with 171 additions and 4 deletions

View File

@@ -20,11 +20,11 @@ interface MacTokenInterface extends StorageInterface
{
/**
* Create a MAC key linked to an access token
* @param string $macKey
* @param \League\OAuth2\Server\Entity\AccessTokenEntity $accessTokenEntity
* @param string $macKey
* @param string $accessToken
* @return void
*/
public function create($macKey, AccessTokenEntity $accessTokenEntity);
public function create($macKey, $accessToken);
/**
* Get a MAC key by access token

View File

@@ -63,9 +63,11 @@ class MAC extends AbstractTokenType implements TokenTypeInterface
preg_match_all('/([a-zA-Z]*)="([\w=]*)"/', $param, $matches);
// @codeCoverageIgnoreStart
if (count($matches) !== 3) {
return;
}
// @codeCoverageIgnoreEnd
$key = reset($matches[1]);
$value = trim(reset($matches[2]));
@@ -74,7 +76,7 @@ class MAC extends AbstractTokenType implements TokenTypeInterface
return;
}
$params->add($key, $value);
$params->set($key, $value);
}, $paramsRaw);
// Validate parameters