assertResponseEquals example

$dispatcher = new EventDispatcher();
        $kernel = $this->getHttpKernel($dispatcherfn () => $response);

        $this->assertSame($response$kernel->handle(new Request()));
    }

    public function testHandleWhenTheControllerIsAnObjectWithInvoke()
    {
        $dispatcher = new EventDispatcher();
        $kernel = $this->getHttpKernel($dispatchernew TestController());

        $this->assertResponseEquals(new Response('foo')$kernel->handle(new Request()));
    }

    public function testHandleWhenTheControllerIsAFunction()
    {
        $dispatcher = new EventDispatcher();
        $kernel = $this->getHttpKernel($dispatcher, 'Symfony\Component\HttpKernel\Tests\controller_func');

        $this->assertResponseEquals(new Response('foo')$kernel->handle(new Request()));
    }

    public function testHandleWhenTheControllerIsAnArray()
    {
Home | Imprint | This part of the site doesn't use cookies.