Merge branch '4.4' into 5.0
* 4.4: fix deps Relax transient test
This commit is contained in:
commit
bf47b7d960
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\WebProfilerBundle\Tests\Controller;
|
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\FrameworkBundle\Test\WebTestCase;
|
||||||
use Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController;
|
use Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController;
|
||||||
use Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler;
|
use Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler;
|
||||||
@ -45,7 +45,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testHomeActionRedirect()
|
public function testHomeActionRedirect()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/_profiler/');
|
$client->request('GET', '/_profiler/');
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testPanelActionWithLatestTokenWhenNoTokensExist()
|
public function testPanelActionWithLatestTokenWhenNoTokensExist()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/_profiler/latest');
|
$client->request('GET', '/_profiler/latest');
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testPanelActionWithLatestToken()
|
public function testPanelActionWithLatestToken()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/');
|
$client->request('GET', '/');
|
||||||
$client->request('GET', '/_profiler/latest');
|
$client->request('GET', '/_profiler/latest');
|
||||||
@ -77,7 +77,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testPanelActionWithoutValidToken()
|
public function testPanelActionWithoutValidToken()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/_profiler/this-token-does-not-exist');
|
$client->request('GET', '/_profiler/this-token-does-not-exist');
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testPanelActionWithWrongPanel()
|
public function testPanelActionWithWrongPanel()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/');
|
$client->request('GET', '/');
|
||||||
$client->request('GET', '/_profiler/latest?panel=this-panel-does-not-exist');
|
$client->request('GET', '/_profiler/latest?panel=this-panel-does-not-exist');
|
||||||
@ -98,13 +98,12 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testPanelActionWithValidPanelAndToken()
|
public function testPanelActionWithValidPanelAndToken()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/');
|
$client->request('GET', '/');
|
||||||
$crawler = $client->request('GET', '/_profiler/latest?panel=router');
|
$crawler = $client->request('GET', '/_profiler/latest?panel=router');
|
||||||
|
|
||||||
$this->assertSame('_', $crawler->filter('.metrics .metric .value')->eq(0)->text());
|
$this->assertSame('_', $crawler->filter('.metrics .metric .value')->eq(0)->text());
|
||||||
$this->assertSame('12', $crawler->filter('.metrics .metric .value')->eq(1)->text());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testToolbarActionWithProfilerDisabled()
|
public function testToolbarActionWithProfilerDisabled()
|
||||||
@ -225,7 +224,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testSearchBarActionDefaultPage()
|
public function testSearchBarActionDefaultPage()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/_profiler/search_bar');
|
$crawler = $client->request('GET', '/_profiler/search_bar');
|
||||||
|
|
||||||
@ -317,7 +316,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testSearchActionWithToken()
|
public function testSearchActionWithToken()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/');
|
$client->request('GET', '/');
|
||||||
$token = $client->getResponse()->headers->get('x-debug-token');
|
$token = $client->getResponse()->headers->get('x-debug-token');
|
||||||
@ -330,14 +329,14 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testSearchActionWithoutToken()
|
public function testSearchActionWithoutToken()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
$client->followRedirects();
|
$client->followRedirects();
|
||||||
|
|
||||||
$client->request('GET', '/');
|
$client->request('GET', '/');
|
||||||
$token = $client->getResponse()->headers->get('x-debug-token');
|
$token = $client->getResponse()->headers->get('x-debug-token');
|
||||||
$client->request('GET', '/_profiler/search?ip=&method=GET&status_code=&url=&token=&start=&end=&limit=10');
|
$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('<a href="/_profiler/%s">%s</a>', $token, $token), $client->getResponse()->getContent());
|
$this->assertStringContainsString(sprintf('<a href="/_profiler/%s">%s</a>', $token, $token), $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +355,7 @@ class ProfilerControllerTest extends WebTestCase
|
|||||||
public function testPhpinfoAction()
|
public function testPhpinfoAction()
|
||||||
{
|
{
|
||||||
$kernel = new WebProfilerBundleKernel();
|
$kernel = new WebProfilerBundleKernel();
|
||||||
$client = new Client($kernel);
|
$client = new KernelBrowser($kernel);
|
||||||
|
|
||||||
$client->request('GET', '/_profiler/phpinfo');
|
$client->request('GET', '/_profiler/phpinfo');
|
||||||
|
|
||||||
|
@ -21,18 +21,6 @@ class WebProfilerBundleKernel extends Kernel
|
|||||||
parent::__construct('test', false);
|
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()
|
public function registerBundles()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
Reference in New Issue
Block a user