Completed
Push — develop ( b0c1cf...96d23e )
by Christoffer
05:18
created
tests/unit/OAuth2ServiceTest.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,15 +34,15 @@
 block discarded – undo
34 34
      */
35 35
     public function testAssertIssueAccessToken()
36 36
     {
37
-       $this->specify('verify service issueAccessToken', function () {
38
-           $authorizationServer = $this->createAuthorizationServer();
39
-           $authorizationServer->expects($this->once())
40
-               ->method('issueAccessToken')
41
-               ->will($this->returnValue(self::$token));
37
+        $this->specify('verify service issueAccessToken', function () {
38
+            $authorizationServer = $this->createAuthorizationServer();
39
+            $authorizationServer->expects($this->once())
40
+                ->method('issueAccessToken')
41
+                ->will($this->returnValue(self::$token));
42 42
 
43
-           $service = new OAuth2Service($authorizationServer, $this->createResourceServer());
44
-           verify($service->issueAccessToken())->equals(self::$token);
45
-       });
43
+            $service = new OAuth2Service($authorizationServer, $this->createResourceServer());
44
+            verify($service->issueAccessToken())->equals(self::$token);
45
+        });
46 46
     }
47 47
 
48 48
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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');
Please login to merge, or discard this patch.
tests/unit/OAuth2MiddlewareTest.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
      */
35 35
     public function testAssertValidAccessToken()
36 36
     {
37
-       $this->specify('verify middleware valid access token', function () {
38
-           $_SERVER['HTTP_AUTHORIZATION'] = 'Bearer mF_9.B5f-4.1JqM';
39
-           $middleware = new OAuth2Middleware();
40
-           verify($middleware->handle($this->createRequest(), function () { return true; }))->equals(true);
41
-       });
37
+        $this->specify('verify middleware valid access token', function () {
38
+            $_SERVER['HTTP_AUTHORIZATION'] = 'Bearer mF_9.B5f-4.1JqM';
39
+            $middleware = new OAuth2Middleware();
40
+            verify($middleware->handle($this->createRequest(), function () { return true; }))->equals(true);
41
+        });
42 42
     }
43 43
 
44 44
     /**
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__ . '/../_support/Mock/MockStorageServiceProvider.php';
3
+require_once __DIR__.'/../_support/Mock/MockStorageServiceProvider.php';
4 4
 
5 5
 use Nord\Lumen\OAuth2\OAuth2ServiceProvider;
6 6
 use Nord\Lumen\OAuth2\Middleware\OAuth2Middleware;
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function testAssertValidAccessToken()
36 36
     {
37
-       $this->specify('verify middleware valid access token', function () {
37
+       $this->specify('verify middleware valid access token', function() {
38 38
            $_SERVER['HTTP_AUTHORIZATION'] = 'Bearer mF_9.B5f-4.1JqM';
39 39
            $middleware = new OAuth2Middleware();
40
-           verify($middleware->handle($this->createRequest(), function () { return true; }))->equals(true);
40
+           verify($middleware->handle($this->createRequest(), function() { return true; }))->equals(true);
41 41
        });
42 42
     }
43 43
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function testAssertInvalidAccessToken()
48 48
     {
49
-        $this->specify('verify middleware invalid access token', function () {
49
+        $this->specify('verify middleware invalid access token', function() {
50 50
             $middleware = new OAuth2Middleware();
51
-            $res = $middleware->handle($this->createRequest(), function () { return true; });
51
+            $res = $middleware->handle($this->createRequest(), function() { return true; });
52 52
             verify($res)->isInstanceOf(Illuminate\Http\JsonResponse::class);
53
-            verify((array)$res->getData())->equals(['message' => 'ERROR.ACCESS_DENIED']);
53
+            verify((array) $res->getData())->equals(['message' => 'ERROR.ACCESS_DENIED']);
54 54
         });
55 55
     }
56 56
 
Please login to merge, or discard this patch.