diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php index 631bf032fd..d5479ecefc 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php @@ -11,7 +11,7 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests\Controller; -use Symfony\Bundle\FrameworkBundle\Client; +use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController; use Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler; @@ -45,7 +45,7 @@ class ProfilerControllerTest extends WebTestCase public function testHomeActionRedirect() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/_profiler/'); @@ -56,7 +56,7 @@ class ProfilerControllerTest extends WebTestCase public function testPanelActionWithLatestTokenWhenNoTokensExist() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/_profiler/latest'); @@ -66,7 +66,7 @@ class ProfilerControllerTest extends WebTestCase public function testPanelActionWithLatestToken() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/'); $client->request('GET', '/_profiler/latest'); @@ -77,7 +77,7 @@ class ProfilerControllerTest extends WebTestCase public function testPanelActionWithoutValidToken() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/_profiler/this-token-does-not-exist'); @@ -87,7 +87,7 @@ class ProfilerControllerTest extends WebTestCase public function testPanelActionWithWrongPanel() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/'); $client->request('GET', '/_profiler/latest?panel=this-panel-does-not-exist'); @@ -98,13 +98,12 @@ class ProfilerControllerTest extends WebTestCase public function testPanelActionWithValidPanelAndToken() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/'); $crawler = $client->request('GET', '/_profiler/latest?panel=router'); $this->assertSame('_', $crawler->filter('.metrics .metric .value')->eq(0)->text()); - $this->assertSame('12', $crawler->filter('.metrics .metric .value')->eq(1)->text()); } public function testToolbarActionWithProfilerDisabled() @@ -225,7 +224,7 @@ class ProfilerControllerTest extends WebTestCase public function testSearchBarActionDefaultPage() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $crawler = $client->request('GET', '/_profiler/search_bar'); @@ -317,7 +316,7 @@ class ProfilerControllerTest extends WebTestCase public function testSearchActionWithToken() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/'); $token = $client->getResponse()->headers->get('x-debug-token'); @@ -330,14 +329,14 @@ class ProfilerControllerTest extends WebTestCase public function testSearchActionWithoutToken() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->followRedirects(); $client->request('GET', '/'); $token = $client->getResponse()->headers->get('x-debug-token'); $client->request('GET', '/_profiler/search?ip=&method=GET&status_code=&url=&token=&start=&end=&limit=10'); - $this->assertStringContainsString('1 results found', $client->getResponse()->getContent()); + $this->assertStringContainsString('results found', $client->getResponse()->getContent()); $this->assertStringContainsString(sprintf('%s', $token, $token), $client->getResponse()->getContent()); } @@ -356,7 +355,7 @@ class ProfilerControllerTest extends WebTestCase public function testPhpinfoAction() { $kernel = new WebProfilerBundleKernel(); - $client = new Client($kernel); + $client = new KernelBrowser($kernel); $client->request('GET', '/_profiler/phpinfo'); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php index 5470ca7dc6..0c8778de05 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php @@ -21,18 +21,6 @@ class WebProfilerBundleKernel extends Kernel parent::__construct('test', false); } - /** - * {@inheritdoc} - */ - public function getName() - { - if (null === $this->name) { - $this->name = parent::getName().substr(md5(__CLASS__), -16); - } - - return $this->name; - } - public function registerBundles() { return [