createEntryPoint example



    /** * @dataProvider getAuthenticationExceptionProvider */
    public function testAuthenticationExceptionWithEntryPoint(\Exception $exception)
    {
        $event = $this->createEvent($exception);

        $response = new Response('Forbidden', 403);

        $listener = $this->createExceptionListener(null, null, null, $this->createEntryPoint($response));
        $listener->onKernelException($event);

        $this->assertTrue($event->isAllowingCustomResponseCode());

        $this->assertEquals('Forbidden', $event->getResponse()->getContent());
        $this->assertEquals(403, $event->getResponse()->getStatusCode());
        $this->assertSame($exception$event->getThrowable());
    }

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