5
5
namespace Http \HttplugBundle \Tests \Unit \DependencyInjection ;
6
6
7
7
use Http \Adapter \Guzzle7 \Client ;
8
- use Http \Client \Common \Plugin \ThrottlePlugin ;
9
8
use Http \Client \Plugin \Vcr \Recorder \InMemoryRecorder ;
10
9
use Http \HttplugBundle \Collector \PluginClientFactoryListener ;
11
10
use Http \HttplugBundle \DependencyInjection \HttplugExtension ;
@@ -145,6 +144,9 @@ public function testClientPlugins(): void
145
144
[
146
145
'response_seekable_body ' => true ,
147
146
],
147
+ 'throttle ' => [
148
+ 'name ' => 'limiter.test ' ,
149
+ ],
148
150
[
149
151
'authentication ' => [
150
152
'my_basic ' => [
@@ -168,13 +170,6 @@ public function testClientPlugins(): void
168
170
],
169
171
],
170
172
];
171
- if (class_exists (ThrottlePlugin::class)) {
172
- $ config ['clients ' ]['acme ' ]['plugins ' ][] = [
173
- 'throttle ' => [
174
- 'name ' => 'limiter.test ' ,
175
- ],
176
- ];
177
- }
178
173
179
174
$ this ->load ($ config );
180
175
@@ -192,13 +187,11 @@ public function testClientPlugins(): void
192
187
'httplug.client.acme.plugin.query_defaults ' ,
193
188
'httplug.client.acme.plugin.request_seekable_body ' ,
194
189
'httplug.client.acme.plugin.response_seekable_body ' ,
190
+ 'httplug.client.acme.plugin.throttle ' ,
195
191
'httplug.client.acme.authentication.my_basic ' ,
196
192
'httplug.client.acme.plugin.cache ' ,
197
193
'httplug.client.acme.plugin.error ' ,
198
194
];
199
- if (\class_exists (ThrottlePlugin::class)) {
200
- $ plugins [] = 'httplug.client.acme.plugin.throttle ' ;
201
- }
202
195
$ pluginReferences = array_map (fn ($ id ) => new Reference ($ id ), $ plugins );
203
196
204
197
$ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
0 commit comments