PsrResponseListener example

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\ViewEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

/** * @author Kévin Dunglas <dunglas@gmail.com> */
class PsrResponseListenerTest extends TestCase
{
    public function testConvertsControllerResult()
    {
        $listener = new PsrResponseListener();
        $event = $this->createEventMock(new Response());
        $listener->onKernelView($event);

        self::assertTrue($event->hasResponse());
    }

    public function testDoesNotConvertControllerResult()
    {
        $listener = new PsrResponseListener();
        $event = $this->createEventMock([]);

        
Home | Imprint | This part of the site doesn't use cookies.