5858use Symfony \Component \HttpClient \Exception \ChunkCacheItemNotFoundException ;
5959use Symfony \Component \HttpClient \MockHttpClient ;
6060use Symfony \Component \HttpClient \RetryableHttpClient ;
61- use Symfony \Component \HttpClient \ScopingHttpClient ;
6261use Symfony \Component \HttpClient \ThrottlingHttpClient ;
6362use Symfony \Component \HttpFoundation \IpUtils ;
6463use Symfony \Component \HttpKernel \DependencyInjection \LoggerPass ;
107106use Symfony \Component \Workflow \WorkflowEvents ;
108107use Symfony \Contracts \Cache \CacheInterface ;
109108use Symfony \Contracts \Cache \TagAwareCacheInterface ;
109+ use Symfony \Contracts \HttpClient \HttpClientInterface ;
110110
111111abstract class FrameworkExtensionTestCase extends TestCase
112112{
@@ -2210,16 +2210,16 @@ public function testHttpClientDefaultOptions()
22102210
22112211 $ this ->assertTrue ($ container ->hasDefinition ('foo ' ), 'should have the "foo" service. ' );
22122212 $ definition = $ container ->getDefinition ('foo ' );
2213- $ this ->assertSame (ScopingHttpClient ::class, $ definition ->getClass ());
2214- $ this ->assertTrue ($ definition ->hasTag ('kernel.reset ' ));
2213+ $ this ->assertSame (HttpClientInterface ::class, $ definition ->getClass ());
2214+ $ this ->assertTrue ($ definition ->hasTag ('http_client.client ' ));
22152215 }
22162216
22172217 public function testScopedHttpClientWithoutQueryOption ()
22182218 {
22192219 $ container = $ this ->createContainerFromFile ('http_client_scoped_without_query_option ' );
22202220
22212221 $ this ->assertTrue ($ container ->hasDefinition ('foo ' ), 'should have the "foo" service. ' );
2222- $ this ->assertSame (ScopingHttpClient ::class, $ container ->getDefinition ('foo ' )->getClass ());
2222+ $ this ->assertSame (HttpClientInterface ::class, $ container ->getDefinition ('foo ' )->getClass ());
22232223 }
22242224
22252225 public function testHttpClientOverrideDefaultOptions ()
@@ -2229,7 +2229,7 @@ public function testHttpClientOverrideDefaultOptions()
22292229 $ this ->assertSame (['foo ' => 'bar ' ], $ container ->getDefinition ('http_client.transport ' )->getArgument (0 )['headers ' ]);
22302230 $ this ->assertSame (['foo ' => 'bar ' ], $ container ->getDefinition ('http_client.transport ' )->getArgument (0 )['extra ' ]);
22312231 $ this ->assertSame (4 , $ container ->getDefinition ('http_client.transport ' )->getArgument (1 ));
2232- $ this ->assertSame ('http://example.com ' , $ container ->getDefinition ('foo ' )->getArgument (1 ));
2232+ $ this ->assertSame ('http://example.com ' , $ container ->getDefinition ('foo.scoping ' )->getArgument (1 ));
22332233
22342234 $ expected = [
22352235 'headers ' => [
@@ -2241,7 +2241,7 @@ public function testHttpClientOverrideDefaultOptions()
22412241 'query ' => [],
22422242 'resolve ' => [],
22432243 ];
2244- $ this ->assertEquals ($ expected , $ container ->getDefinition ('foo ' )->getArgument (2 ));
2244+ $ this ->assertEquals ($ expected , $ container ->getDefinition ('foo.scoping ' )->getArgument (2 ));
22452245 }
22462246
22472247 public function testCachingHttpClient ()
@@ -2258,26 +2258,26 @@ public function testCachingHttpClient()
22582258 $ this ->assertSame ('http_client ' , $ definition ->getDecoratedService ()[0 ]);
22592259 $ this ->assertCount (5 , $ arguments = $ definition ->getArguments ());
22602260 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2261- $ this ->assertSame ('http_client.caching .inner ' , (string ) $ arguments [0 ]);
2261+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
22622262 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
22632263 $ this ->assertSame ('foo ' , (string ) $ arguments [1 ]);
22642264 $ this ->assertArrayHasKey ('headers ' , $ arguments [2 ]);
22652265 $ this ->assertSame (['X-powered ' => 'PHP ' ], $ arguments [2 ]['headers ' ]);
22662266 $ this ->assertFalse ($ arguments [3 ]);
22672267 $ this ->assertSame (2 , $ arguments [4 ]);
22682268
2269- $ this ->assertTrue ($ container ->hasDefinition ('bar.transport. caching ' ));
2270- $ definition = $ container ->getDefinition ('bar.transport. caching ' );
2269+ $ this ->assertTrue ($ container ->hasDefinition ('bar.caching ' ));
2270+ $ definition = $ container ->getDefinition ('bar.caching ' );
22712271 $ this ->assertSame (CachingHttpClient::class, $ definition ->getClass ());
22722272 $ arguments = $ definition ->getArguments ();
22732273 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2274- $ this ->assertSame ('bar.transport.caching .inner ' , (string ) $ arguments [0 ]);
2274+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
22752275 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
22762276 $ this ->assertSame ('baz ' , (string ) $ arguments [1 ]);
2277- $ scopedClient = $ container ->getDefinition ('bar ' );
2277+ $ scopedClient = $ container ->getDefinition ('bar.scoping ' );
22782278
2279- $ this ->assertSame ('bar.transport ' , (string ) $ scopedClient ->getArgument (0 ));
2280- $ this ->assertNull ( $ scopedClient ->getDecoratedService ());
2279+ $ this ->assertSame ('.inner ' , (string ) $ scopedClient ->getArgument (0 ));
2280+ $ this ->assertSame ( ' bar ' , $ scopedClient ->getDecoratedService ()[ 0 ] );
22812281 }
22822282
22832283 public function testHttpClientRetry ()
@@ -2291,8 +2291,8 @@ public function testHttpClientRetry()
22912291 $ this ->assertSame (0.3 , $ container ->getDefinition ('http_client.retry_strategy ' )->getArgument (4 ));
22922292 $ this ->assertSame (2 , $ container ->getDefinition ('http_client.retryable ' )->getArgument (2 ));
22932293
2294- $ this ->assertSame (RetryableHttpClient::class, $ container ->getDefinition ('foo.transport. retryable ' )->getClass ());
2295- $ this ->assertSame (4 , $ container ->getDefinition ('foo.transport. retry_strategy ' )->getArgument (2 ));
2294+ $ this ->assertSame (RetryableHttpClient::class, $ container ->getDefinition ('foo.retryable ' )->getClass ());
2295+ $ this ->assertSame (4 , $ container ->getDefinition ('foo.retry_strategy ' )->getArgument (2 ));
22962296 }
22972297
22982298 public function testHttpClientWithQueryParameterKey ()
@@ -2302,12 +2302,12 @@ public function testHttpClientWithQueryParameterKey()
23022302 $ expected = [
23032303 'key ' => 'foo ' ,
23042304 ];
2305- $ this ->assertSame ($ expected , $ container ->getDefinition ('foo ' )->getArgument (2 )['query ' ]);
2305+ $ this ->assertSame ($ expected , $ container ->getDefinition ('foo.scoping ' )->getArgument (2 )['query ' ]);
23062306
23072307 $ expected = [
23082308 'host ' => '127.0.0.1 ' ,
23092309 ];
2310- $ this ->assertSame ($ expected , $ container ->getDefinition ('foo ' )->getArgument (2 )['resolve ' ]);
2310+ $ this ->assertSame ($ expected , $ container ->getDefinition ('foo.scoping ' )->getArgument (2 )['resolve ' ]);
23112311 }
23122312
23132313 public function testHttpClientFullDefaultOptions ()
@@ -2353,19 +2353,19 @@ public function testHttpClientRateLimiter()
23532353 $ this ->assertSame ('http_client ' , $ definition ->getDecoratedService ()[0 ]);
23542354 $ this ->assertCount (2 , $ arguments = $ definition ->getArguments ());
23552355 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2356- $ this ->assertSame ('http_client.throttling .inner ' , (string ) $ arguments [0 ]);
2356+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
23572357 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
23582358 $ this ->assertSame ('http_client.throttling.limiter ' , (string ) $ arguments [1 ]);
23592359
2360- $ this ->assertTrue ($ container ->hasDefinition ('foo.transport. throttling ' ));
2361- $ definition = $ container ->getDefinition ('foo.transport. throttling ' );
2360+ $ this ->assertTrue ($ container ->hasDefinition ('foo.throttling ' ));
2361+ $ definition = $ container ->getDefinition ('foo.throttling ' );
23622362 $ this ->assertSame (ThrottlingHttpClient::class, $ definition ->getClass ());
2363- $ this ->assertSame ('foo.transport ' , $ definition ->getDecoratedService ()[0 ]);
2363+ $ this ->assertSame ('foo ' , $ definition ->getDecoratedService ()[0 ]);
23642364 $ this ->assertCount (2 , $ arguments = $ definition ->getArguments ());
23652365 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2366- $ this ->assertSame ('foo.transport.throttling .inner ' , (string ) $ arguments [0 ]);
2366+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
23672367 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
2368- $ this ->assertSame ('foo.transport. throttling.limiter ' , (string ) $ arguments [1 ]);
2368+ $ this ->assertSame ('foo.throttling.limiter ' , (string ) $ arguments [1 ]);
23692369 }
23702370
23712371 public static function provideMailer (): iterable
0 commit comments