Passed
Push — master ( 033b76...80b8b4 )
by Anton
02:44
created
tests/Framework/Http/CookiesTest.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function testHasCookie(): void
38 38
     {
39
-        $this->http->setHandler(function () {
39
+        $this->http->setHandler(function ()
40
+        {
40 41
             return (int)$this->cookies()->has('a');
41 42
         });
42 43
 
@@ -54,7 +55,8 @@  discard block
 block discarded – undo
54 55
         ]);
55 56
         $this->http = $this->app->get(Http::class);
56 57
 
57
-        $this->http->setHandler(function () {
58
+        $this->http->setHandler(function ()
59
+        {
58 60
             return (int)$this->cookies()->has('a');
59 61
         });
60 62
 
@@ -71,7 +73,8 @@  discard block
 block discarded – undo
71 73
         $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]);
72 74
         $this->http = $this->app->get(Http::class);
73 75
 
74
-        $this->http->setHandler(function () {
76
+        $this->http->setHandler(function ()
77
+        {
75 78
             return $this->cookies()->get('a');
76 79
         });
77 80
 
@@ -88,7 +91,8 @@  discard block
 block discarded – undo
88 91
         $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]);
89 92
         $this->http = $this->app->get(Http::class);
90 93
 
91
-        $this->http->setHandler(function () {
94
+        $this->http->setHandler(function ()
95
+        {
92 96
             $this->cookies()->set('a', 'value');
93 97
 
94 98
             return 'ok';
@@ -112,7 +116,8 @@  discard block
 block discarded – undo
112 116
         $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]);
113 117
         $this->http = $this->app->get(Http::class);
114 118
 
115
-        $this->http->setHandler(function () {
119
+        $this->http->setHandler(function ()
120
+        {
116 121
             $this->cookies()->schedule(Cookie::create('a', 'value'));
117 122
             $this->assertSame([], $this->cookies()->getAll());
118 123
             $this->assertCount(1, $this->cookies()->getScheduled());
@@ -138,7 +143,8 @@  discard block
 block discarded – undo
138 143
         $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]);
139 144
         $this->http = $this->app->get(Http::class);
140 145
 
141
-        $this->http->setHandler(function () {
146
+        $this->http->setHandler(function ()
147
+        {
142 148
             $this->cookies()->delete('cookie');
143 149
 
144 150
             return 'ok';
Please login to merge, or discard this patch.
tests/app/src/Controller/AuthController.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,12 @@  discard block
 block discarded – undo
26 26
         $this->auth = $auth;
27 27
     }
28 28
 
29
-    public function do(GuardInterface $guard)
29
+    public function do{
30
+        (GuardInterface $guard)
30 31
     {
31 32
         if (!$guard->allows('do')) {
32 33
             throw new ControllerException("Unauthorized permission 'do'", ControllerException::FORBIDDEN);
34
+    }
33 35
         }
34 36
 
35 37
         return 'ok';
@@ -37,7 +39,8 @@  discard block
 block discarded – undo
37 39
 
38 40
     public function token(AuthContextInterface $authContext)
39 41
     {
40
-        if ($authContext->getToken() !== null) {
42
+        if ($authContext->getToken() !== null)
43
+        {
41 44
             return $authContext->getToken()->getID();
42 45
         }
43 46
 
@@ -55,7 +58,8 @@  discard block
 block discarded – undo
55 58
 
56 59
     public function token2()
57 60
     {
58
-        if ($this->auth->getToken() !== null) {
61
+        if ($this->auth->getToken() !== null)
62
+        {
59 63
             return $this->auth->getToken()->getID();
60 64
         }
61 65
 
Please login to merge, or discard this patch.