Skip to content

Commit a5b7885

Browse files
committed
always test with throttle plugin as all supported PHP versions are compatible now
1 parent 8222bf4 commit a5b7885

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

.github/workflows/continuous-integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- dependencies: "php-http/guzzle7-adapter"
3535
php-version: "8.2"
3636
symfony-deprecations-helper: "weak"
37-
- dependencies: "php-http/guzzle7-adapter php-http/throttle-plugin"
37+
- dependencies: "php-http/guzzle7-adapter"
3838
php-version: "8.3"
3939
symfony-deprecations-helper: "weak"
4040

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
"symfony/options-resolver": "^6.4 || ^7.1"
4343
},
4444
"conflict": {
45+
"kriswallsmith/buzz": "<0.17",
4546
"php-http/guzzle6-adapter": "<1.1",
4647
"php-http/cache-plugin": "<1.7",
4748
"php-http/curl-client": "<2.0",
4849
"php-http/socket-client": "<2.0",
49-
"kriswallsmith/buzz": "<0.17",
5050
"php-http/react-adapter": "<3.0",
5151
"php-http/throttle-plugin": "<1.1"
5252
},
@@ -59,6 +59,7 @@
5959
"php-http/cache-plugin": "^1.7",
6060
"php-http/mock-client": "^1.2",
6161
"php-http/promise": "^1.0",
62+
"php-http/throttle-plugin": "^1.1",
6263
"phpunit/phpunit": "^9",
6364
"symfony/browser-kit": "^6.4 || ^7.1",
6465
"symfony/cache": "^6.4 || ^7.1",

tests/Unit/DependencyInjection/HttplugExtensionTest.php

+6-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Http\HttplugBundle\Tests\Unit\DependencyInjection;
66

77
use Http\Adapter\Guzzle7\Client;
8-
use Http\Client\Common\Plugin\ThrottlePlugin;
98
use Http\Client\Plugin\Vcr\Recorder\InMemoryRecorder;
109
use Http\HttplugBundle\Collector\PluginClientFactoryListener;
1110
use Http\HttplugBundle\DependencyInjection\HttplugExtension;
@@ -145,6 +144,11 @@ public function testClientPlugins(): void
145144
[
146145
'response_seekable_body' => true,
147146
],
147+
[
148+
'throttle' => [
149+
'name' => 'limiter.test',
150+
],
151+
],
148152
[
149153
'authentication' => [
150154
'my_basic' => [
@@ -168,13 +172,6 @@ public function testClientPlugins(): void
168172
],
169173
],
170174
];
171-
if (class_exists(ThrottlePlugin::class)) {
172-
$config['clients']['acme']['plugins'][] = [
173-
'throttle' => [
174-
'name' => 'limiter.test',
175-
],
176-
];
177-
}
178175

179176
$this->load($config);
180177

@@ -192,13 +189,11 @@ public function testClientPlugins(): void
192189
'httplug.client.acme.plugin.query_defaults',
193190
'httplug.client.acme.plugin.request_seekable_body',
194191
'httplug.client.acme.plugin.response_seekable_body',
192+
'httplug.client.acme.plugin.throttle',
195193
'httplug.client.acme.authentication.my_basic',
196194
'httplug.client.acme.plugin.cache',
197195
'httplug.client.acme.plugin.error',
198196
];
199-
if (\class_exists(ThrottlePlugin::class)) {
200-
$plugins[] = 'httplug.client.acme.plugin.throttle';
201-
}
202197
$pluginReferences = array_map(fn ($id) => new Reference($id), $plugins);
203198

204199
$this->assertContainerBuilderHasService('httplug.client.acme');

0 commit comments

Comments
 (0)