|
8 | 8 |
|
9 | 9 | class MultiCurlTest extends \PHPUnit\Framework\TestCase |
10 | 10 | { |
| 11 | + private $skip_slow_tests; |
| 12 | + |
| 13 | + protected function setUp(): void |
| 14 | + { |
| 15 | + $this->skip_slow_tests = in_array(getenv('PHP_CURL_CLASS_SKIP_SLOW_TESTS'), ['1', 'y', 'Y']); |
| 16 | + } |
| 17 | + |
11 | 18 | public function testMultiCurlCallback() |
12 | 19 | { |
13 | 20 | $delete_before_send_called = false; |
@@ -370,6 +377,10 @@ public function testMultiCurlCallback() |
370 | 377 |
|
371 | 378 | public function testMultiCurlCallbackError() |
372 | 379 | { |
| 380 | + if ($this->skip_slow_tests) { |
| 381 | + $this->markTestSkipped(); |
| 382 | + } |
| 383 | + |
373 | 384 | $delete_before_send_called = false; |
374 | 385 | $delete_success_called = false; |
375 | 386 | $delete_error_called = false; |
@@ -1168,6 +1179,10 @@ public function testCurlCallback() |
1168 | 1179 |
|
1169 | 1180 | public function testCurlCallbackError() |
1170 | 1181 | { |
| 1182 | + if ($this->skip_slow_tests) { |
| 1183 | + $this->markTestSkipped(); |
| 1184 | + } |
| 1185 | + |
1171 | 1186 | $multi_curl = new MultiCurl(); |
1172 | 1187 |
|
1173 | 1188 | $delete_before_send_called = false; |
@@ -2758,6 +2773,10 @@ public function testDownloadErrorDeleteTemporaryFile() |
2758 | 2773 |
|
2759 | 2774 | public function testDownloadCallbackError() |
2760 | 2775 | { |
| 2776 | + if ($this->skip_slow_tests) { |
| 2777 | + $this->markTestSkipped(); |
| 2778 | + } |
| 2779 | + |
2761 | 2780 | $download_before_send_called = false; |
2762 | 2781 | $download_callback_called = false; |
2763 | 2782 | $multi_curl = new MultiCurl(); |
@@ -3710,6 +3729,10 @@ public function testSetRateLimitUnits() |
3710 | 3729 |
|
3711 | 3730 | public function testSetRateLimitPerSecond1() |
3712 | 3731 | { |
| 3732 | + if ($this->skip_slow_tests) { |
| 3733 | + $this->markTestSkipped(); |
| 3734 | + } |
| 3735 | + |
3713 | 3736 | // R0--| |
3714 | 3737 | // R1--| |
3715 | 3738 | // W---------------| |
@@ -3779,6 +3802,10 @@ public function testSetRateLimitPerSecond1() |
3779 | 3802 |
|
3780 | 3803 | public function testSetRateLimitPerSecond2() |
3781 | 3804 | { |
| 3805 | + if ($this->skip_slow_tests) { |
| 3806 | + $this->markTestSkipped(); |
| 3807 | + } |
| 3808 | + |
3782 | 3809 | // R0--| |
3783 | 3810 | // R1------| |
3784 | 3811 | // W-----------| |
@@ -3848,6 +3875,10 @@ public function testSetRateLimitPerSecond2() |
3848 | 3875 |
|
3849 | 3876 | public function testSetRateLimitPerSecond3() |
3850 | 3877 | { |
| 3878 | + if ($this->skip_slow_tests) { |
| 3879 | + $this->markTestSkipped(); |
| 3880 | + } |
| 3881 | + |
3851 | 3882 | // R0------| |
3852 | 3883 | // R1------------------| |
3853 | 3884 | // R2------| |
@@ -3915,6 +3946,10 @@ public function testSetRateLimitPerSecond3() |
3915 | 3946 |
|
3916 | 3947 | public function testSetRateLimitPerSecond4() |
3917 | 3948 | { |
| 3949 | + if ($this->skip_slow_tests) { |
| 3950 | + $this->markTestSkipped(); |
| 3951 | + } |
| 3952 | + |
3918 | 3953 | // R0------| |
3919 | 3954 | // R1----------------------------------| |
3920 | 3955 | // R2----------| |
@@ -3982,6 +4017,10 @@ public function testSetRateLimitPerSecond4() |
3982 | 4017 |
|
3983 | 4018 | public function testSetRateLimitPerSecond5() |
3984 | 4019 | { |
| 4020 | + if ($this->skip_slow_tests) { |
| 4021 | + $this->markTestSkipped(); |
| 4022 | + } |
| 4023 | + |
3985 | 4024 | // R0--------------------------| |
3986 | 4025 | // R1--------------------------| |
3987 | 4026 | // R2------| |
@@ -4050,6 +4089,10 @@ public function testSetRateLimitPerSecond5() |
4050 | 4089 |
|
4051 | 4090 | public function testSetRateLimitPerSecond6() |
4052 | 4091 | { |
| 4092 | + if ($this->skip_slow_tests) { |
| 4093 | + $this->markTestSkipped(); |
| 4094 | + } |
| 4095 | + |
4053 | 4096 | // R0--------------------------| |
4054 | 4097 | // R1--------------------------| |
4055 | 4098 | // R2--------------| |
@@ -4118,6 +4161,10 @@ public function testSetRateLimitPerSecond6() |
4118 | 4161 |
|
4119 | 4162 | public function testSetRateLimitPerSecond7() |
4120 | 4163 | { |
| 4164 | + if ($this->skip_slow_tests) { |
| 4165 | + $this->markTestSkipped(); |
| 4166 | + } |
| 4167 | + |
4121 | 4168 | // R0------| |
4122 | 4169 | // R1----------------------------------------------| |
4123 | 4170 | // R2----------------------| |
@@ -4194,6 +4241,10 @@ public function testSetRateLimitPerSecond7() |
4194 | 4241 |
|
4195 | 4242 | public function testSetRateLimitPerSecond8() |
4196 | 4243 | { |
| 4244 | + if ($this->skip_slow_tests) { |
| 4245 | + $this->markTestSkipped(); |
| 4246 | + } |
| 4247 | + |
4197 | 4248 | // R0------------------------------| |
4198 | 4249 | // R1----------------------------------------------| |
4199 | 4250 | // R2--------------------------| |
@@ -4270,6 +4321,10 @@ public function testSetRateLimitPerSecond8() |
4270 | 4321 |
|
4271 | 4322 | public function testSetRateLimitPerSecond9() |
4272 | 4323 | { |
| 4324 | + if ($this->skip_slow_tests) { |
| 4325 | + $this->markTestSkipped(); |
| 4326 | + } |
| 4327 | + |
4273 | 4328 | // R0----------------------------------------------| |
4274 | 4329 | // R1----------------------------------------------| |
4275 | 4330 | // R2--------------------------| |
@@ -4346,6 +4401,10 @@ public function testSetRateLimitPerSecond9() |
4346 | 4401 |
|
4347 | 4402 | public function testSetRateLimitPerSecondOnePerSecond() |
4348 | 4403 | { |
| 4404 | + if ($this->skip_slow_tests) { |
| 4405 | + $this->markTestSkipped(); |
| 4406 | + } |
| 4407 | + |
4349 | 4408 | $request_stats = []; |
4350 | 4409 |
|
4351 | 4410 | $multi_curl = new MultiCurl(); |
@@ -4380,6 +4439,10 @@ public function testSetRateLimitPerSecondOnePerSecond() |
4380 | 4439 |
|
4381 | 4440 | public function testSetRateLimitFivePerThirtySecond() |
4382 | 4441 | { |
| 4442 | + if ($this->skip_slow_tests) { |
| 4443 | + $this->markTestSkipped(); |
| 4444 | + } |
| 4445 | + |
4383 | 4446 | $request_stats = []; |
4384 | 4447 |
|
4385 | 4448 | $multi_curl = new MultiCurl(); |
@@ -4410,6 +4473,10 @@ public function testSetRateLimitFivePerThirtySecond() |
4410 | 4473 |
|
4411 | 4474 | public function testSetRateLimitOnePerOneMinute() |
4412 | 4475 | { |
| 4476 | + if ($this->skip_slow_tests) { |
| 4477 | + $this->markTestSkipped(); |
| 4478 | + } |
| 4479 | + |
4413 | 4480 | $request_stats = []; |
4414 | 4481 |
|
4415 | 4482 | $multi_curl = new MultiCurl(); |
@@ -4440,6 +4507,10 @@ public function testSetRateLimitOnePerOneMinute() |
4440 | 4507 |
|
4441 | 4508 | public function testSetRateLimitThreePerOneMinute() |
4442 | 4509 | { |
| 4510 | + if ($this->skip_slow_tests) { |
| 4511 | + $this->markTestSkipped(); |
| 4512 | + } |
| 4513 | + |
4443 | 4514 | $request_stats = []; |
4444 | 4515 |
|
4445 | 4516 | $multi_curl = new MultiCurl(); |
@@ -4468,6 +4539,10 @@ public function testSetRateLimitThreePerOneMinute() |
4468 | 4539 |
|
4469 | 4540 | public function testSetRateLimitThreePerSixtyFiveSeconds() |
4470 | 4541 | { |
| 4542 | + if ($this->skip_slow_tests) { |
| 4543 | + $this->markTestSkipped(); |
| 4544 | + } |
| 4545 | + |
4471 | 4546 | $request_stats = []; |
4472 | 4547 |
|
4473 | 4548 | $multi_curl = new MultiCurl(); |
@@ -4496,6 +4571,10 @@ public function testSetRateLimitThreePerSixtyFiveSeconds() |
4496 | 4571 |
|
4497 | 4572 | public function testSetRateLimitTenPerTwoMinutes() |
4498 | 4573 | { |
| 4574 | + if ($this->skip_slow_tests) { |
| 4575 | + $this->markTestSkipped(); |
| 4576 | + } |
| 4577 | + |
4499 | 4578 | $request_stats = []; |
4500 | 4579 |
|
4501 | 4580 | $multi_curl = new MultiCurl(); |
|
0 commit comments