Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4:
  fix deps
  Relax transient test
  • Loading branch information
nicolas-grekas committed Jan 9, 2020
2 parents cf3239a + a8baff6 commit 438d072
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
25 changes: 12 additions & 13 deletions Tests/Controller/ProfilerControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -45,7 +45,7 @@ public function testHomeActionWithProfilerDisabled()
public function testHomeActionRedirect()
{
$kernel = new WebProfilerBundleKernel();
$client = new Client($kernel);
$client = new KernelBrowser($kernel);

$client->request('GET', '/_profiler/');

Expand All @@ -56,7 +56,7 @@ public function testHomeActionRedirect()
public function testPanelActionWithLatestTokenWhenNoTokensExist()
{
$kernel = new WebProfilerBundleKernel();
$client = new Client($kernel);
$client = new KernelBrowser($kernel);

$client->request('GET', '/_profiler/latest');

Expand All @@ -66,7 +66,7 @@ public function testPanelActionWithLatestTokenWhenNoTokensExist()
public function testPanelActionWithLatestToken()
{
$kernel = new WebProfilerBundleKernel();
$client = new Client($kernel);
$client = new KernelBrowser($kernel);

$client->request('GET', '/');
$client->request('GET', '/_profiler/latest');
Expand All @@ -77,7 +77,7 @@ public function testPanelActionWithLatestToken()
public function testPanelActionWithoutValidToken()
{
$kernel = new WebProfilerBundleKernel();
$client = new Client($kernel);
$client = new KernelBrowser($kernel);

$client->request('GET', '/_profiler/this-token-does-not-exist');

Expand All @@ -87,7 +87,7 @@ public function testPanelActionWithoutValidToken()
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');
Expand All @@ -98,13 +98,12 @@ public function testPanelActionWithWrongPanel()
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()
Expand Down Expand Up @@ -225,7 +224,7 @@ public function testSearchBarActionWithProfilerDisabled()
public function testSearchBarActionDefaultPage()
{
$kernel = new WebProfilerBundleKernel();
$client = new Client($kernel);
$client = new KernelBrowser($kernel);

$crawler = $client->request('GET', '/_profiler/search_bar');

Expand Down Expand Up @@ -317,7 +316,7 @@ public function testSearchActionWithProfilerDisabled()
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');
Expand All @@ -330,14 +329,14 @@ public function testSearchActionWithToken()
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('<a href="/_profiler/%s">%s</a>', $token, $token), $client->getResponse()->getContent());
}

Expand All @@ -356,7 +355,7 @@ public function testPhpinfoActionWithProfilerDisabled()
public function testPhpinfoAction()
{
$kernel = new WebProfilerBundleKernel();
$client = new Client($kernel);
$client = new KernelBrowser($kernel);

$client->request('GET', '/_profiler/phpinfo');

Expand Down
12 changes: 0 additions & 12 deletions Tests/Functional/WebProfilerBundleKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ public function __construct()
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 [
Expand Down

0 comments on commit 438d072

Please sign in to comment.