class InternalRequestEngine implements RequestEngineInterface (View source)

A Request Engine which uses Flow's request dispatcher directly for processing HTTP requests internally.

This engine is particularly useful in functional test scenarios.

Properties

protected Bootstrap $bootstrap
protected Dispatcher $dispatcher
protected RouterInterface $router
protected Context $securityContext
protected ConfigurationManager $configurationManager
protected ValidatorResolver $validatorResolver
protected PersistenceManagerInterface $persistenceManager
protected ServerRequestFactoryInterface $serverRequestFactory
protected ResponseFactoryInterface $responseFactory
protected StreamFactoryInterface $contentFactory

Methods

ResponseInterface
sendRequest(RequestInterface $httpRequest)

Sends the given HTTP request

getRouter()

Returns the router used by this internal request engine

ResponseInterface
prepareErrorResponse(object $exception, ResponseInterface $response)

Prepare a response in case an error occurred.

Details

ResponseInterface sendRequest(RequestInterface $httpRequest)

Sends the given HTTP request

Parameters

RequestInterface $httpRequest

Return Value

ResponseInterface

Exceptions

Exception
Exception

RouterInterface getRouter()

Returns the router used by this internal request engine

Return Value

RouterInterface

protected ResponseInterface prepareErrorResponse(object $exception, ResponseInterface $response)

Prepare a response in case an error occurred.

Parameters

object $exception

\Exception or \Throwable

ResponseInterface $response

Return Value

ResponseInterface