1111
1212namespace Symfony \Bundle \WebProfilerBundle \Tests \Controller ;
1313
14- use Symfony \Bundle \FrameworkBundle \Client ;
14+ use Symfony \Bundle \FrameworkBundle \KernelBrowser ;
1515use Symfony \Bundle \FrameworkBundle \Test \WebTestCase ;
1616use Symfony \Bundle \WebProfilerBundle \Controller \ProfilerController ;
1717use Symfony \Bundle \WebProfilerBundle \Csp \ContentSecurityPolicyHandler ;
@@ -45,7 +45,7 @@ public function testHomeActionWithProfilerDisabled()
4545 public function testHomeActionRedirect ()
4646 {
4747 $ kernel = new WebProfilerBundleKernel ();
48- $ client = new Client ($ kernel );
48+ $ client = new KernelBrowser ($ kernel );
4949
5050 $ client ->request ('GET ' , '/_profiler/ ' );
5151
@@ -56,7 +56,7 @@ public function testHomeActionRedirect()
5656 public function testPanelActionWithLatestTokenWhenNoTokensExist ()
5757 {
5858 $ kernel = new WebProfilerBundleKernel ();
59- $ client = new Client ($ kernel );
59+ $ client = new KernelBrowser ($ kernel );
6060
6161 $ client ->request ('GET ' , '/_profiler/latest ' );
6262
@@ -66,7 +66,7 @@ public function testPanelActionWithLatestTokenWhenNoTokensExist()
6666 public function testPanelActionWithLatestToken ()
6767 {
6868 $ kernel = new WebProfilerBundleKernel ();
69- $ client = new Client ($ kernel );
69+ $ client = new KernelBrowser ($ kernel );
7070
7171 $ client ->request ('GET ' , '/ ' );
7272 $ client ->request ('GET ' , '/_profiler/latest ' );
@@ -77,7 +77,7 @@ public function testPanelActionWithLatestToken()
7777 public function testPanelActionWithoutValidToken ()
7878 {
7979 $ kernel = new WebProfilerBundleKernel ();
80- $ client = new Client ($ kernel );
80+ $ client = new KernelBrowser ($ kernel );
8181
8282 $ client ->request ('GET ' , '/_profiler/this-token-does-not-exist ' );
8383
@@ -87,7 +87,7 @@ public function testPanelActionWithoutValidToken()
8787 public function testPanelActionWithWrongPanel ()
8888 {
8989 $ kernel = new WebProfilerBundleKernel ();
90- $ client = new Client ($ kernel );
90+ $ client = new KernelBrowser ($ kernel );
9191
9292 $ client ->request ('GET ' , '/ ' );
9393 $ client ->request ('GET ' , '/_profiler/latest?panel=this-panel-does-not-exist ' );
@@ -98,13 +98,12 @@ public function testPanelActionWithWrongPanel()
9898 public function testPanelActionWithValidPanelAndToken ()
9999 {
100100 $ kernel = new WebProfilerBundleKernel ();
101- $ client = new Client ($ kernel );
101+ $ client = new KernelBrowser ($ kernel );
102102
103103 $ client ->request ('GET ' , '/ ' );
104104 $ crawler = $ client ->request ('GET ' , '/_profiler/latest?panel=router ' );
105105
106106 $ this ->assertSame ('_ ' , $ crawler ->filter ('.metrics .metric .value ' )->eq (0 )->text ());
107- $ this ->assertSame ('12 ' , $ crawler ->filter ('.metrics .metric .value ' )->eq (1 )->text ());
108107 }
109108
110109 public function testToolbarActionWithProfilerDisabled ()
@@ -225,7 +224,7 @@ public function testSearchBarActionWithProfilerDisabled()
225224 public function testSearchBarActionDefaultPage ()
226225 {
227226 $ kernel = new WebProfilerBundleKernel ();
228- $ client = new Client ($ kernel );
227+ $ client = new KernelBrowser ($ kernel );
229228
230229 $ crawler = $ client ->request ('GET ' , '/_profiler/search_bar ' );
231230
@@ -317,7 +316,7 @@ public function testSearchActionWithProfilerDisabled()
317316 public function testSearchActionWithToken ()
318317 {
319318 $ kernel = new WebProfilerBundleKernel ();
320- $ client = new Client ($ kernel );
319+ $ client = new KernelBrowser ($ kernel );
321320
322321 $ client ->request ('GET ' , '/ ' );
323322 $ token = $ client ->getResponse ()->headers ->get ('x-debug-token ' );
@@ -330,14 +329,14 @@ public function testSearchActionWithToken()
330329 public function testSearchActionWithoutToken ()
331330 {
332331 $ kernel = new WebProfilerBundleKernel ();
333- $ client = new Client ($ kernel );
332+ $ client = new KernelBrowser ($ kernel );
334333 $ client ->followRedirects ();
335334
336335 $ client ->request ('GET ' , '/ ' );
337336 $ token = $ client ->getResponse ()->headers ->get ('x-debug-token ' );
338337 $ client ->request ('GET ' , '/_profiler/search?ip=&method=GET&status_code=&url=&token=&start=&end=&limit=10 ' );
339338
340- $ this ->assertStringContainsString ('1 results found ' , $ client ->getResponse ()->getContent ());
339+ $ this ->assertStringContainsString ('results found ' , $ client ->getResponse ()->getContent ());
341340 $ this ->assertStringContainsString (sprintf ('<a href="/_profiler/%s">%s</a> ' , $ token , $ token ), $ client ->getResponse ()->getContent ());
342341 }
343342
@@ -356,7 +355,7 @@ public function testPhpinfoActionWithProfilerDisabled()
356355 public function testPhpinfoAction ()
357356 {
358357 $ kernel = new WebProfilerBundleKernel ();
359- $ client = new Client ($ kernel );
358+ $ client = new KernelBrowser ($ kernel );
360359
361360 $ client ->request ('GET ' , '/_profiler/phpinfo ' );
362361
0 commit comments