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,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