55namespace Http \HttplugBundle \Tests \Unit \DependencyInjection ;
66
77use Http \Adapter \Guzzle7 \Client ;
8- use Http \Client \Common \Plugin \ThrottlePlugin ;
98use Http \Client \Plugin \Vcr \Recorder \InMemoryRecorder ;
109use Http \HttplugBundle \Collector \PluginClientFactoryListener ;
1110use 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