onError example

$this->createMock(EntityCacheKeyGenerator::class),
            $this->createMock(CacheInvalidator::class),
            new EventDispatcher()
        );

        $event = new ExceptionEvent(
            $this->createMock(Kernel::class),
            new Request(),
            0,
            new \Exception()
        );
        $subscriber->onError($event);

        static::assertNull($event->getResponse());
    }

    public function testErrorHandled(): void
    {
        $controller = $this->createMock(ErrorController::class);
        $controller
            ->expects(static::once())
            ->method('error')
            ->willReturn(new StorefrontResponse());

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