Passed
Push — master ( 5555ce...f15488 )
by Arthur
04:40
created
src/Foundation/Abstracts/Tests/HttpTest.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     private function getUserTokenData(): \stdClass
46 46
     {
47
-        return Cache::remember('testing:http_access_token', 60, function () {
47
+        return Cache::remember('testing:http_access_token', 60, function() {
48 48
             try {
49 49
                 $httpClient = new Client();
50 50
                 $domain = 'https://astral.eu.auth0.com/';
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 $username = env('AUTH0_TEST_USER_NAME');
53 53
                 $password = env('AUTH0_TEST_USER_PASS');
54 54
 
55
-                $response = $httpClient->post($domain . 'oauth/token', [
55
+                $response = $httpClient->post($domain.'oauth/token', [
56 56
                     'form_params' => [
57 57
                         'grant_type' => 'password',
58 58
                         'client_id' => $clientId,
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 ]);
64 64
                 return json_decode($response->getBody()->getContents());
65 65
             } catch (ClientException $exception) {
66
-                throw new Exception("Could not obtain token from Auth0 for testing from $domain $clientId $username $password" . $exception->getMessage());
66
+                throw new Exception("Could not obtain token from Auth0 for testing from $domain $clientId $username $password".$exception->getMessage());
67 67
             }
68 68
         });
69 69
     }
@@ -71,30 +71,30 @@  discard block
 block discarded – undo
71 71
     protected function decodeHttpContent($content, $unwrap = true)
72 72
     {
73 73
         if ($unwrap)
74
-            return json_decode($content, true)['data'];
74
+            return json_decode($content, true)[ 'data' ];
75 75
         return json_decode($content, true);
76 76
     }
77 77
 
78
-    protected function http(string $method, string $route, array $payload = [])
78
+    protected function http(string $method, string $route, array $payload = [ ])
79 79
     {
80 80
         return $this->sendRequest($method, $route, $payload, true);
81 81
     }
82 82
 
83
-    private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse
83
+    private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse
84 84
     {
85
-        return $this->json($method, env('API_URL') . '/' . $route, $payload, $authenticated ? [
86
-            'Authorization' => 'Bearer ' . $this->getUserTokenData()->id_token,
87
-        ] : []);
85
+        return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [
86
+            'Authorization' => 'Bearer '.$this->getUserTokenData()->id_token,
87
+        ] : [ ]);
88 88
     }
89 89
 
90
-    protected function sendRequestWithToken($token, string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse
90
+    protected function sendRequestWithToken($token, string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse
91 91
     {
92
-        return $this->json($method, env('API_URL') . '/' . $route, $payload, $authenticated ? [
93
-            'Authorization' => 'Bearer ' . $token,
94
-        ] : []);
92
+        return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [
93
+            'Authorization' => 'Bearer '.$token,
94
+        ] : [ ]);
95 95
     }
96 96
 
97
-    protected function httpNoAuth(string $method, string $route, array $payload = [])
97
+    protected function httpNoAuth(string $method, string $route, array $payload = [ ])
98 98
     {
99 99
         return $this->sendRequest($method, $route, $payload, false);
100 100
     }
Please login to merge, or discard this patch.