@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | protected function registerBindings(Container $container, ConfigRepository $config) |
| 44 | 44 | { |
| 45 | - $container->bind(OAuth2Service::class, function ($container) use ($config) { |
|
| 45 | + $container->bind(OAuth2Service::class, function($container) use ($config) { |
|
| 46 | 46 | return $this->createService($container, $config[self::CONFIG_KEY]); |
| 47 | 47 | }); |
| 48 | 48 | |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Nord\Lumen\OAuth2\Exceptions\InvalidArgument; |
| 10 | 10 | use Illuminate\Config\Repository as ConfigRepository; |
| 11 | 11 | use Illuminate\Support\ServiceProvider; |
| 12 | -use Laravel\Lumen\Application; |
|
| 13 | 12 | use League\OAuth2\Server\AuthorizationServer; |
| 14 | 13 | use League\OAuth2\Server\Grant\PasswordGrant; |
| 15 | 14 | use League\OAuth2\Server\ResourceServer; |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | // @codingStandardsIgnoreFile |
| 7 | 7 | |
| 8 | 8 | use Codeception\Module\Asserts; |
| 9 | -use Helper\Unit; |
|
| 10 | 9 | |
| 11 | 10 | trait UnitTesterActions |
| 12 | 11 | { |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | use _generated\UnitTesterActions; |
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Define custom actions here |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * Define custom actions here |
|
| 25 | + */ |
|
| 26 | 26 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $entity = new AccessTokenEntity($this->server); |
| 18 | 18 | |
| 19 | 19 | $entity->setId('mF_9.B5f-4.1JqM'); |
| 20 | - $entity->setExpireTime(time() + 24*60*60); // NOW + 24h |
|
| 20 | + $entity->setExpireTime(time() + 24 * 60 * 60); // NOW + 24h |
|
| 21 | 21 | |
| 22 | 22 | return $entity; |
| 23 | 23 | } |
@@ -9,6 +9,6 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | public function __construct($basePath = null) |
| 11 | 11 | { |
| 12 | - parent::__construct(realpath(__DIR__ . '/../')); |
|
| 12 | + parent::__construct(realpath(__DIR__.'/../')); |
|
| 13 | 13 | } |
| 14 | 14 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | 'grant_types' => [ |
| 45 | 45 | 'password' => [ |
| 46 | 46 | 'class' => League\OAuth2\Server\Grant\PasswordGrant::class, |
| 47 | - 'callback' => function ($username, $password) { |
|
| 47 | + 'callback' => function($username, $password) { |
|
| 48 | 48 | return $username.'/'.$password; |
| 49 | 49 | }, |
| 50 | 50 | 'access_token_ttl' => 3600, |
@@ -3,4 +3,4 @@ |
||
| 3 | 3 | |
| 4 | 4 | date_default_timezone_set('UTC'); |
| 5 | 5 | |
| 6 | -require __DIR__ . '/../vendor/autoload.php'; |
|
| 6 | +require __DIR__.'/../vendor/autoload.php'; |
|
@@ -37,8 +37,8 @@ |
||
| 37 | 37 | $this->specify('verify service issueAccessToken', function () { |
| 38 | 38 | $authorizationServer = $this->createAuthorizationServer(); |
| 39 | 39 | $authorizationServer->expects($this->once()) |
| 40 | - ->method('issueAccessToken') |
|
| 41 | - ->will($this->returnValue(self::$token)); |
|
| 40 | + ->method('issueAccessToken') |
|
| 41 | + ->will($this->returnValue(self::$token)); |
|
| 42 | 42 | |
| 43 | 43 | $service = new OAuth2Service($authorizationServer, $this->createResourceServer()); |
| 44 | 44 | verify($service->issueAccessToken())->equals(self::$token); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function testAssertIssueAccessToken() |
| 36 | 36 | { |
| 37 | - $this->specify('verify service issueAccessToken', function () { |
|
| 37 | + $this->specify('verify service issueAccessToken', function() { |
|
| 38 | 38 | $authorizationServer = $this->createAuthorizationServer(); |
| 39 | 39 | $authorizationServer->expects($this->once()) |
| 40 | 40 | ->method('issueAccessToken') |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function testAssertValidateAccessToken() |
| 52 | 52 | { |
| 53 | - $this->specify('verify service validateAccessToken', function () { |
|
| 53 | + $this->specify('verify service validateAccessToken', function() { |
|
| 54 | 54 | $service = new OAuth2Service($this->createAuthorizationServer(), $this->createResourceServer()); |
| 55 | 55 | verify($service->validateAccessToken(true, self::$token['access_token']))->true(); |
| 56 | 56 | }); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function testAssertGetResourceOwnerId() |
| 63 | 63 | { |
| 64 | - $this->specify('verify service can getResourceOwnerId', function () { |
|
| 64 | + $this->specify('verify service can getResourceOwnerId', function() { |
|
| 65 | 65 | $service = new OAuth2Service($this->createAuthorizationServer(), $this->createResourceServer()); |
| 66 | 66 | $service->validateAccessToken(true, self::$token['access_token']); |
| 67 | 67 | verify($service->getResourceOwnerId())->equals('test'); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function testAssertGetResourceOwnerType() |
| 75 | 75 | { |
| 76 | - $this->specify('verify service can getResourceOwnerType', function () { |
|
| 76 | + $this->specify('verify service can getResourceOwnerType', function() { |
|
| 77 | 77 | $service = new OAuth2Service($this->createAuthorizationServer(), $this->createResourceServer()); |
| 78 | 78 | $service->validateAccessToken(true, self::$token['access_token']); |
| 79 | 79 | verify($service->getResourceOwnerType())->equals('test'); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function testAssertGetClientId() |
| 87 | 87 | { |
| 88 | - $this->specify('verify service can getClientId', function () { |
|
| 88 | + $this->specify('verify service can getClientId', function() { |
|
| 89 | 89 | $service = new OAuth2Service($this->createAuthorizationServer(), $this->createResourceServer()); |
| 90 | 90 | $service->validateAccessToken(true, self::$token['access_token']); |
| 91 | 91 | verify($service->getClientId())->equals('test'); |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * @return \League\OAuth2\Server\AuthorizationServer|\PHPUnit_Framework_MockObject_MockObject |
|
| 98 | + * @return \League\OAuth2\Server\AuthorizationServer |
|
| 99 | 99 | */ |
| 100 | 100 | private function createAuthorizationServer() |
| 101 | 101 | { |
@@ -29,23 +29,23 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | protected function registerContainerBindings(Container $container) |
| 31 | 31 | { |
| 32 | - $container->bind(MockAccessTokenStorage::class, function () { |
|
| 32 | + $container->bind(MockAccessTokenStorage::class, function() { |
|
| 33 | 33 | return new MockAccessTokenStorage; |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | - $container->bind(MockClientStorage::class, function () { |
|
| 36 | + $container->bind(MockClientStorage::class, function() { |
|
| 37 | 37 | return new MockClientStorage; |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | - $container->bind(MockRefreshTokenStorage::class, function () { |
|
| 40 | + $container->bind(MockRefreshTokenStorage::class, function() { |
|
| 41 | 41 | return new MockRefreshTokenStorage; |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | - $container->bind(MockScopeStorage::class, function () { |
|
| 44 | + $container->bind(MockScopeStorage::class, function() { |
|
| 45 | 45 | return new MockScopeStorage; |
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | - $container->bind(MockSessionStorage::class, function () { |
|
| 48 | + $container->bind(MockSessionStorage::class, function() { |
|
| 49 | 49 | return new MockSessionStorage; |
| 50 | 50 | }); |
| 51 | 51 | |