mockRequest example


        return new RequestEvent($this->createMock(HttpKernelInterface::class)$request$requestType);
    }

    private function getFinishRequestEvent(Request $request): FinishRequestEvent
    {
        return new FinishRequestEvent($this->createMock(HttpKernelInterface::class)$request, HttpKernelInterface::MAIN_REQUEST);
    }

    private function mockEmptyRequest(): Request
    {
        return $this->mockRequest([]);
    }

    private function mockFilledRequest(string $controller = self::TEST_CONTROLLER): Request
    {
        return $this->mockRequest([
            '_controller' => $controller,
            '_route' => self::TEST_ROUTE,
            '_route_params' => self::TEST_PARAMS,
        ]);
    }

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