Completed
Push — master ( 2a2a91...9e8812 )
by Владислав
02:55 queued 42s
created
tests/DeCaptchaAbstractTest.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     public function testGetBaseUrl()
17 17
     {
18 18
         $abstract = $this->newInstance();
19
-        $getBaseUrlCaller = function () {
19
+        $getBaseUrlCaller = function() {
20 20
             return $this->getBaseUrl();
21 21
         };
22 22
         $abstract->domain = 'domain';
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $abstract = $this->newInstance();
30 30
         $abstract->setApiKey('123456val');
31
-        $apiKeyValCaller = function () {
31
+        $apiKeyValCaller = function() {
32 32
             return $this->apiKey;
33 33
         };
34 34
         $bound = $apiKeyValCaller->bindTo($abstract, $abstract);
35 35
         $this->assertEquals('123456val', $bound());
36 36
 
37
-        $abstract->setApiKey(function () {
38
-            return '123456'.'fun';
37
+        $abstract->setApiKey(function() {
38
+            return '123456' . 'fun';
39 39
         });
40
-        $apiKeyFunCaller = function () {
40
+        $apiKeyFunCaller = function() {
41 41
             return $this->apiKey;
42 42
         };
43 43
         $bound = $apiKeyFunCaller->bindTo($abstract, $abstract);
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
     public function testGetActionUrl()
48 48
     {
49 49
         $abstract = $this->newInstance();
50
-        $getBaseUrlGetCodeCaller = function () {
50
+        $getBaseUrlGetCodeCaller = function() {
51 51
             $this->captchaId = 123;
52 52
 
53 53
             return $this->getActionUrl('get_code');
54 54
         };
55
-        $getBaseUrlGetBalanceCaller = function () {
55
+        $getBaseUrlGetBalanceCaller = function() {
56 56
             $this->captchaId = 234;
57 57
 
58 58
             return $this->getActionUrl('get_balance');
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
     public function testGetFilePath()
69 69
     {
70 70
         $abstract = $this->newInstance();
71
-        $getFilePathCaller = function ($val) {
71
+        $getFilePathCaller = function($val) {
72 72
             return $this->getFilePath($val);
73 73
         };
74 74
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
75
-        $this->assertEquals(__DIR__.'/data/Captcha.jpg', $bound(__DIR__.'/data/Captcha.jpg'));
75
+        $this->assertEquals(__DIR__ . '/data/Captcha.jpg', $bound(__DIR__ . '/data/Captcha.jpg'));
76 76
         $filePathUpload = $bound('https://upload.wikimedia.org/wikipedia/commons/6/69/Captcha.jpg');
77
-        $file1 = file_get_contents(__DIR__.'/data/Captcha.jpg');
77
+        $file1 = file_get_contents(__DIR__ . '/data/Captcha.jpg');
78 78
         $file2 = file_get_contents($filePathUpload);
79 79
         $this->assertEquals($file1, $file2);
80 80
     }
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
     public function testGetFilePathErrorFileNotFound()
87 87
     {
88 88
         $abstract = $this->newInstance();
89
-        $getFilePathCaller = function ($val) {
89
+        $getFilePathCaller = function($val) {
90 90
             return $this->getFilePath($val);
91 91
         };
92 92
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
93
-        $bound(__DIR__.'/data/Captcha1.jpg');
93
+        $bound(__DIR__ . '/data/Captcha1.jpg');
94 94
     }
95 95
 
96 96
     /**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function testGetFilePathErrorFileIsNotLoaded()
102 102
     {
103 103
         $abstract = $this->newInstance();
104
-        $getFilePathCaller = function ($val) {
104
+        $getFilePathCaller = function($val) {
105 105
             return $this->getFilePath($val);
106 106
         };
107 107
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $abstract = $this->newInstance();
114 114
         $abstract->domain = 'echo.jsontest.com/aaa/bbb';
115
-        $getResponseCaller = function ($val) {
115
+        $getResponseCaller = function($val) {
116 116
             return $this->getResponse($val);
117 117
         };
118 118
         $bound = $getResponseCaller->bindTo($abstract, $abstract);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function testExecutionDelayed()
124 124
     {
125 125
         $abstract = $this->newInstance();
126
-        $executionDelayedCaller = function ($second, $call = null) {
126
+        $executionDelayedCaller = function($second, $call = null) {
127 127
             return $this->executionDelayed($second, $call);
128 128
         };
129 129
         $bound = $executionDelayedCaller->bindTo($abstract, $abstract);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $this->assertTrue(abs($timePassed - 0.1) < 0.035);
135 135
 
136 136
         $start = microtime(true);
137
-        $bound(0.15, function () {
137
+        $bound(0.15, function() {
138 138
             sleep(0.2);
139 139
         });
140 140
         $bound(0.1);
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
         $this->assertTrue(abs($timePassed - 0.25) < 0.035);
143 143
 
144 144
         $start = microtime(true);
145
-        $bound(0.15, function () {
145
+        $bound(0.15, function() {
146 146
             sleep(0.2);
147 147
         });
148 148
         $bound(0.3);
149 149
         $timePassed = microtime(true) - $start;
150 150
         $this->assertTrue(abs($timePassed - 0.45) < 0.035);
151 151
 
152
-        $this->assertEquals(2, $bound(0, function () {
152
+        $this->assertEquals(2, $bound(0, function() {
153 153
             return 2;
154 154
         }));
155 155
         $this->assertEquals(null, $bound(0));
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     public function testGetInUrl()
159 159
     {
160 160
         $abstract = $this->newInstance();
161
-        $getInUrlCaller = function () {
161
+        $getInUrlCaller = function() {
162 162
             return $this->getInUrl();
163 163
         };
164 164
         $abstract->domain = 'domain';
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     public function testIsError()
175 175
     {
176 176
         $abstract = $this->newInstance();
177
-        $isErrorCaller = function ($val) {
177
+        $isErrorCaller = function($val) {
178 178
             return $this->isError($val);
179 179
         };
180 180
         $bound = $isErrorCaller->bindTo($abstract, $abstract);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     public function testIsErrorNot()
185 185
     {
186 186
         $abstract = $this->newInstance();
187
-        $isErrorCaller = function ($val) {
187
+        $isErrorCaller = function($val) {
188 188
             return $this->isError($val);
189 189
         };
190 190
         $bound = $isErrorCaller->bindTo($abstract, $abstract);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     {
201 201
         $abstract = $this->newInstance();
202 202
         $abstract->domain = 'domain';
203
-        $getCurlResponseCaller = function ($val) {
203
+        $getCurlResponseCaller = function($val) {
204 204
             return $this->getCurlResponse($val);
205 205
         };
206 206
         $bound = $getCurlResponseCaller->bindTo($abstract, $abstract);
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     {
212 212
         $abstract = $this->newInstance();
213 213
         $abstract->domain = 'httpbin.org';
214
-        $getCurlResponseCaller = function ($val) {
214
+        $getCurlResponseCaller = function($val) {
215 215
             $this->inUrl = 'post';
216 216
 
217 217
             return $this->getCurlResponse($val);
Please login to merge, or discard this patch.