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{
@@ -2239,16 +2239,16 @@ public function testHttpClientDefaultOptions()
22392239
22402240 $ this ->assertTrue ($ container ->hasDefinition ('foo ' ), 'should have the "foo" service. ' );
22412241 $ definition = $ container ->getDefinition ('foo ' );
2242- $ this ->assertSame (ScopingHttpClient ::class, $ definition ->getClass ());
2243- $ this ->assertTrue ($ definition ->hasTag ('kernel.reset ' ));
2242+ $ this ->assertSame (HttpClientInterface ::class, $ definition ->getClass ());
2243+ $ this ->assertTrue ($ definition ->hasTag ('http_client.client ' ));
22442244 }
22452245
22462246 public function testScopedHttpClientWithoutQueryOption ()
22472247 {
22482248 $ container = $ this ->createContainerFromFile ('http_client_scoped_without_query_option ' );
22492249
22502250 $ this ->assertTrue ($ container ->hasDefinition ('foo ' ), 'should have the "foo" service. ' );
2251- $ this ->assertSame (ScopingHttpClient ::class, $ container ->getDefinition ('foo ' )->getClass ());
2251+ $ this ->assertSame (HttpClientInterface ::class, $ container ->getDefinition ('foo ' )->getClass ());
22522252 }
22532253
22542254 public function testHttpClientOverrideDefaultOptions ()
@@ -2258,7 +2258,7 @@ public function testHttpClientOverrideDefaultOptions()
22582258 $ this ->assertSame (['foo ' => 'bar ' ], $ container ->getDefinition ('http_client.transport ' )->getArgument (0 )['headers ' ]);
22592259 $ this ->assertSame (['foo ' => 'bar ' ], $ container ->getDefinition ('http_client.transport ' )->getArgument (0 )['extra ' ]);
22602260 $ this ->assertSame (4 , $ container ->getDefinition ('http_client.transport ' )->getArgument (1 ));
2261- $ this ->assertSame ('http://example.com ' , $ container ->getDefinition ('foo ' )->getArgument (1 ));
2261+ $ this ->assertSame ('http://example.com ' , $ container ->getDefinition ('foo.scoping ' )->getArgument (1 ));
22622262
22632263 $ expected = [
22642264 'headers ' => [
@@ -2270,7 +2270,7 @@ public function testHttpClientOverrideDefaultOptions()
22702270 'query ' => [],
22712271 'resolve ' => [],
22722272 ];
2273- $ this ->assertEquals ($ expected , $ container ->getDefinition ('foo ' )->getArgument (2 ));
2273+ $ this ->assertEquals ($ expected , $ container ->getDefinition ('foo.scoping ' )->getArgument (2 ));
22742274 }
22752275
22762276 public function testCachingHttpClient ()
@@ -2287,26 +2287,26 @@ public function testCachingHttpClient()
22872287 $ this ->assertSame ('http_client ' , $ definition ->getDecoratedService ()[0 ]);
22882288 $ this ->assertCount (5 , $ arguments = $ definition ->getArguments ());
22892289 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2290- $ this ->assertSame ('http_client.caching .inner ' , (string ) $ arguments [0 ]);
2290+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
22912291 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
22922292 $ this ->assertSame ('foo ' , (string ) $ arguments [1 ]);
22932293 $ this ->assertArrayHasKey ('headers ' , $ arguments [2 ]);
22942294 $ this ->assertSame (['X-powered ' => 'PHP ' ], $ arguments [2 ]['headers ' ]);
22952295 $ this ->assertFalse ($ arguments [3 ]);
22962296 $ this ->assertSame (2 , $ arguments [4 ]);
22972297
2298- $ this ->assertTrue ($ container ->hasDefinition ('bar.transport. caching ' ));
2299- $ definition = $ container ->getDefinition ('bar.transport. caching ' );
2298+ $ this ->assertTrue ($ container ->hasDefinition ('bar.caching ' ));
2299+ $ definition = $ container ->getDefinition ('bar.caching ' );
23002300 $ this ->assertSame (CachingHttpClient::class, $ definition ->getClass ());
23012301 $ arguments = $ definition ->getArguments ();
23022302 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2303- $ this ->assertSame ('bar.transport.caching .inner ' , (string ) $ arguments [0 ]);
2303+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
23042304 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
23052305 $ this ->assertSame ('baz ' , (string ) $ arguments [1 ]);
2306- $ scopedClient = $ container ->getDefinition ('bar ' );
2306+ $ scopedClient = $ container ->getDefinition ('bar.scoping ' );
23072307
2308- $ this ->assertSame ('bar.transport ' , (string ) $ scopedClient ->getArgument (0 ));
2309- $ this ->assertNull ( $ scopedClient ->getDecoratedService ());
2308+ $ this ->assertSame ('.inner ' , (string ) $ scopedClient ->getArgument (0 ));
2309+ $ this ->assertSame ( ' bar ' , $ scopedClient ->getDecoratedService ()[ 0 ] );
23102310 }
23112311
23122312 public function testHttpClientRetry ()
@@ -2320,8 +2320,8 @@ public function testHttpClientRetry()
23202320 $ this ->assertSame (0.3 , $ container ->getDefinition ('http_client.retry_strategy ' )->getArgument (4 ));
23212321 $ this ->assertSame (2 , $ container ->getDefinition ('http_client.retryable ' )->getArgument (2 ));
23222322
2323- $ this ->assertSame (RetryableHttpClient::class, $ container ->getDefinition ('foo.transport. retryable ' )->getClass ());
2324- $ this ->assertSame (4 , $ container ->getDefinition ('foo.transport. retry_strategy ' )->getArgument (2 ));
2323+ $ this ->assertSame (RetryableHttpClient::class, $ container ->getDefinition ('foo.retryable ' )->getClass ());
2324+ $ this ->assertSame (4 , $ container ->getDefinition ('foo.retry_strategy ' )->getArgument (2 ));
23252325 }
23262326
23272327 public function testHttpClientWithQueryParameterKey ()
@@ -2331,12 +2331,12 @@ public function testHttpClientWithQueryParameterKey()
23312331 $ expected = [
23322332 'key ' => 'foo ' ,
23332333 ];
2334- $ this ->assertSame ($ expected , $ container ->getDefinition ('foo ' )->getArgument (2 )['query ' ]);
2334+ $ this ->assertSame ($ expected , $ container ->getDefinition ('foo.scoping ' )->getArgument (2 )['query ' ]);
23352335
23362336 $ expected = [
23372337 'host ' => '127.0.0.1 ' ,
23382338 ];
2339- $ this ->assertSame ($ expected , $ container ->getDefinition ('foo ' )->getArgument (2 )['resolve ' ]);
2339+ $ this ->assertSame ($ expected , $ container ->getDefinition ('foo.scoping ' )->getArgument (2 )['resolve ' ]);
23402340 }
23412341
23422342 public function testHttpClientFullDefaultOptions ()
@@ -2382,19 +2382,19 @@ public function testHttpClientRateLimiter()
23822382 $ this ->assertSame ('http_client ' , $ definition ->getDecoratedService ()[0 ]);
23832383 $ this ->assertCount (2 , $ arguments = $ definition ->getArguments ());
23842384 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2385- $ this ->assertSame ('http_client.throttling .inner ' , (string ) $ arguments [0 ]);
2385+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
23862386 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
23872387 $ this ->assertSame ('http_client.throttling.limiter ' , (string ) $ arguments [1 ]);
23882388
2389- $ this ->assertTrue ($ container ->hasDefinition ('foo.transport. throttling ' ));
2390- $ definition = $ container ->getDefinition ('foo.transport. throttling ' );
2389+ $ this ->assertTrue ($ container ->hasDefinition ('foo.throttling ' ));
2390+ $ definition = $ container ->getDefinition ('foo.throttling ' );
23912391 $ this ->assertSame (ThrottlingHttpClient::class, $ definition ->getClass ());
2392- $ this ->assertSame ('foo.transport ' , $ definition ->getDecoratedService ()[0 ]);
2392+ $ this ->assertSame ('foo ' , $ definition ->getDecoratedService ()[0 ]);
23932393 $ this ->assertCount (2 , $ arguments = $ definition ->getArguments ());
23942394 $ this ->assertInstanceOf (Reference::class, $ arguments [0 ]);
2395- $ this ->assertSame ('foo.transport.throttling .inner ' , (string ) $ arguments [0 ]);
2395+ $ this ->assertSame ('.inner ' , (string ) $ arguments [0 ]);
23962396 $ this ->assertInstanceOf (Reference::class, $ arguments [1 ]);
2397- $ this ->assertSame ('foo.transport. throttling.limiter ' , (string ) $ arguments [1 ]);
2397+ $ this ->assertSame ('foo.throttling.limiter ' , (string ) $ arguments [1 ]);
23982398 }
23992399
24002400 public static function provideMailer (): iterable
0 commit comments