[WebProfilerBundle] Added test case for #10806
This commit is contained in:
parent
93926cae34
commit
7b425d229d
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Bundle\WebProfilerBundle\Tests\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
|
||||||
|
use Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
class ProfilerControllerTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @dataProvider getEmptyTokenCases
|
||||||
|
*/
|
||||||
|
public function testEmptyToken($token)
|
||||||
|
{
|
||||||
|
$urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface');
|
||||||
|
$twig = $this->getMock('Twig_Environment');
|
||||||
|
$profiler = $this
|
||||||
|
->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profiler')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
|
$controller = new ProfilerController($urlGenerator, $profiler, $twig, array());
|
||||||
|
|
||||||
|
$response = $controller->toolbarAction(Request::create('/_wdt/empty'), $token);
|
||||||
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmptyTokenCases()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array(null),
|
||||||
|
// "empty" is also a valid empty token case, see https://github.com/symfony/symfony/issues/10806
|
||||||
|
array('empty'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user