22
33namespace Http \HttplugBundle \Tests \Functional ;
44
5- use Http \Client \Common \PluginClient ;
65use Http \Client \HttpAsyncClient ;
76use Http \Client \HttpClient ;
87use Http \Discovery \HttpAsyncClientDiscovery ;
98use Http \Discovery \HttpClientDiscovery ;
109use Http \Discovery \Strategy \CommonClassesStrategy ;
11- use Http \HttplugBundle \Collector \StackPlugin ;
10+ use Http \HttplugBundle \Collector \ProfileClient ;
1211use Http \HttplugBundle \Discovery \ConfiguredClientsStrategy ;
1312use Nyholm \NSA ;
1413use Symfony \Bundle \FrameworkBundle \Test \WebTestCase ;
@@ -24,9 +23,7 @@ public function testDiscoveredClient()
2423
2524 $ service = $ container ->get ('httplug.auto_discovery.auto_discovered_client ' );
2625
27- $ this ->assertInstanceOf (PluginClient::class, $ service );
28- $ this ->assertInstanceOf (HttpClient::class, NSA ::getProperty ($ service , 'client ' ));
29- $ this ->assertEmpty (NSA ::getProperty ($ service , 'plugins ' ));
26+ $ this ->assertInstanceOf (HttpClient::class, $ service );
3027 }
3128
3229 public function testDiscoveredAsyncClient ()
@@ -37,9 +34,7 @@ public function testDiscoveredAsyncClient()
3734
3835 $ service = $ container ->get ('httplug.auto_discovery.auto_discovered_async ' );
3936
40- $ this ->assertInstanceOf (PluginClient::class, $ service );
41- $ this ->assertInstanceOf (HttpAsyncClient::class, NSA ::getProperty ($ service , 'client ' ));
42- $ this ->assertEmpty (NSA ::getProperty ($ service , 'plugins ' ));
37+ $ this ->assertInstanceOf (HttpAsyncClient::class, $ service );
4338 }
4439
4540 public function testDiscoveredClientWithProfilingEnabled ()
@@ -50,13 +45,8 @@ public function testDiscoveredClientWithProfilingEnabled()
5045
5146 $ service = $ container ->get ('httplug.auto_discovery.auto_discovered_client ' );
5247
53- $ this ->assertInstanceOf (PluginClient ::class, $ service );
48+ $ this ->assertInstanceOf (ProfileClient ::class, $ service );
5449 $ this ->assertInstanceOf (HttpClient::class, NSA ::getProperty ($ service , 'client ' ));
55-
56- $ plugins = NSA ::getProperty ($ service , 'plugins ' );
57- $ this ->assertCount (1 , $ plugins );
58- $ this ->assertInstanceOf (StackPlugin::class, $ plugins [0 ]);
59- $ this ->assertEquals ('auto_discovered_client ' , NSA ::getProperty ($ plugins [0 ], 'client ' ));
6050 }
6151
6252 public function testDiscoveredAsyncClientWithProfilingEnabled ()
@@ -67,13 +57,8 @@ public function testDiscoveredAsyncClientWithProfilingEnabled()
6757
6858 $ service = $ container ->get ('httplug.auto_discovery.auto_discovered_async ' );
6959
70- $ this ->assertInstanceOf (PluginClient ::class, $ service );
60+ $ this ->assertInstanceOf (ProfileClient ::class, $ service );
7161 $ this ->assertInstanceOf (HttpAsyncClient::class, NSA ::getProperty ($ service , 'client ' ));
72-
73- $ plugins = NSA ::getProperty ($ service , 'plugins ' );
74- $ this ->assertCount (1 , $ plugins );
75- $ this ->assertInstanceOf (StackPlugin::class, $ plugins [0 ]);
76- $ this ->assertEquals ('auto_discovered_async ' , NSA ::getProperty ($ plugins [0 ], 'client ' ));
7762 }
7863
7964 /**
@@ -92,9 +77,9 @@ public function testDiscovery()
9277 $ httpClient = $ container ->get ('httplug.auto_discovery.auto_discovered_client ' );
9378 $ httpAsyncClient = $ container ->get ('httplug.auto_discovery.auto_discovered_async ' );
9479
95- $ this ->assertInstanceOf (PluginClient ::class, $ httpClient );
80+ $ this ->assertInstanceOf (ProfileClient ::class, $ httpClient );
9681 $ this ->assertSame (HttpClientDiscovery::find (), $ httpClient );
97- $ this ->assertInstanceOf (PluginClient ::class, $ httpAsyncClient );
82+ $ this ->assertInstanceOf (ProfileClient ::class, $ httpAsyncClient );
9883 $ this ->assertSame (HttpAsyncClientDiscovery::find (), $ httpAsyncClient );
9984 }
10085
0 commit comments