Skip to content

Commit 623b1e9

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

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
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

+1
Original file line numberDiff line numberDiff line change
@@ -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

+4-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,9 @@ public function testClientPlugins(): void
145144
[
146145
'response_seekable_body' => true,
147146
],
147+
'throttle' => [
148+
'name' => 'limiter.test',
149+
],
148150
[
149151
'authentication' => [
150152
'my_basic' => [
@@ -168,13 +170,6 @@ public function testClientPlugins(): void
168170
],
169171
],
170172
];
171-
if (class_exists(ThrottlePlugin::class)) {
172-
$config['clients']['acme']['plugins'][] = [
173-
'throttle' => [
174-
'name' => 'limiter.test',
175-
],
176-
];
177-
}
178173

179174
$this->load($config);
180175

@@ -192,13 +187,11 @@ public function testClientPlugins(): void
192187
'httplug.client.acme.plugin.query_defaults',
193188
'httplug.client.acme.plugin.request_seekable_body',
194189
'httplug.client.acme.plugin.response_seekable_body',
190+
'httplug.client.acme.plugin.throttle',
195191
'httplug.client.acme.authentication.my_basic',
196192
'httplug.client.acme.plugin.cache',
197193
'httplug.client.acme.plugin.error',
198194
];
199-
if (\class_exists(ThrottlePlugin::class)) {
200-
$plugins[] = 'httplug.client.acme.plugin.throttle';
201-
}
202195
$pluginReferences = array_map(fn ($id) => new Reference($id), $plugins);
203196

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

0 commit comments

Comments
 (0)