This repository has been archived by the owner on Dec 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
203 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Nord\Lumen\OAuth2\Tests; | ||
|
||
class MockAuthCode | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public static $code = 'tb89gB5f-4_1JqM'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public static $tokenType = 'Bearer'; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public static $expiresIn = 3600; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public static $refreshToken = 'tGzv3JOkF0XG5Qx2TlKWIA'; | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public static function toArray() | ||
{ | ||
return [ | ||
'code' => self::$code, | ||
'token_type' => self::$tokenType, | ||
'expires_in' => self::$expiresIn, | ||
'refresh_token' => self::$refreshToken | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace Nord\Lumen\OAuth2\Tests; | ||
|
||
use League\OAuth2\Server\Entity\AuthCodeEntity; | ||
use League\OAuth2\Server\Entity\ScopeEntity; | ||
use League\OAuth2\Server\Storage\AuthCodeInterface; | ||
|
||
class MockAuthCodeStorage extends MockStorage implements AuthCodeInterface | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function get($token) | ||
{ | ||
$entity = new AuthCodeEntity($this->server); | ||
|
||
$entity->setId('tb89gB5f-4_1JqM'); | ||
$entity->setExpireTime(time() + 24*60*60); // NOW + 24h | ||
|
||
return $entity; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getScopes(AuthCodeEntity $token) | ||
{ | ||
throw new \Exception('Not implemented'); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function create($token, $expireTime, $sessionId, $redirectUri) | ||
{ | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) | ||
{ | ||
throw new \Exception('Not implemented'); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function delete(AuthCodeEntity $token) | ||
{ | ||
} | ||
} |
Oops, something went wrong.