WebDebugToolbarListener example

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Twig\Environment;

class WebDebugToolbarListenerTest extends TestCase
{
    /** * @dataProvider getInjectToolbarTests */
    public function testInjectToolbar($content$expected)
    {
        $listener = new WebDebugToolbarListener($this->getTwigMock());
        $m = new \ReflectionMethod($listener, 'injectToolbar');

        $response = new Response($content);

        $m->invoke($listener$response, Request::create('/')['csp_script_nonce' => 'scripto', 'csp_style_nonce' => 'stylo']);
        $this->assertEquals($expected$response->getContent());
    }

    public static function getInjectToolbarTests()
    {
        return [
            [
Home | Imprint | This part of the site doesn't use cookies.