PHP Class Neos\Flow\Tests\FunctionalTestRequestHandler

As this request handler will be the "active" request handler returned by the bootstrap's getActiveRequestHandler() method, it also needs some support for HTTP request testing scenarios. For that reason it features a setRequest() method which is used by the FunctionalTestCase for setting the current HTTP request. That way, the request handler acts pretty much like the Http\RequestHandler from a client code perspective. The virtual browser's InternalRequestEngine will also set the current request via the setRequest() method.
Inheritance: implements Neos\Flow\Http\HttpRequestHandlerInterface
Afficher le fichier Open project: neos/flow-development-collection

Protected Properties

Свойство Type Description
$bootstrap Neos\Flow\Core\Bootstrap
$componentContext Neos\Flow\Http\Component\ComponentContext

Méthodes publiques

Méthode Description
__construct ( Bootstrap $bootstrap ) Constructor
canHandleRequest ( ) : boolean This request handler can handle requests in Testing Context.
getHttpRequest ( ) : Request Returns the currently processed HTTP request
getHttpResponse ( ) : Response Returns the HTTP response corresponding to the currently handled request
getPriority ( ) : integer Returns the priority - how eager the handler is to actually handle the request.
handleRequest ( ) : void Handles a command line request
setComponentContext ( ComponentContext $context ) : void Allows to set the currently processed HTTP component chain context by the base functional test case.
setHttpRequest ( Request $request ) : void Allows to set the currently processed HTTP request by the base functional test case.
setHttpResponse ( Response $response ) : void Allows to set the currently processed HTTP response by the base functional test case.

Méthodes protégées

Méthode Description
getComponentContext ( ) : ComponentContext Internal getter to ensure an existing ComponentContext.

Method Details

__construct() public méthode

Constructor
public __construct ( Bootstrap $bootstrap )
$bootstrap Neos\Flow\Core\Bootstrap

canHandleRequest() public méthode

This request handler can handle requests in Testing Context.
public canHandleRequest ( ) : boolean
Résultat boolean If the context is Testing, TRUE otherwise FALSE

getComponentContext() protected méthode

Internal getter to ensure an existing ComponentContext.
protected getComponentContext ( ) : ComponentContext
Résultat Neos\Flow\Http\Component\ComponentContext

getHttpRequest() public méthode

Returns the currently processed HTTP request
public getHttpRequest ( ) : Request
Résultat Neos\Flow\Http\Request

getHttpResponse() public méthode

Returns the HTTP response corresponding to the currently handled request
public getHttpResponse ( ) : Response
Résultat Neos\Flow\Http\Response

getPriority() public méthode

As this request handler can only be used as a preselected request handler, the priority for all other cases is 0.
public getPriority ( ) : integer
Résultat integer The priority of the request handler.

handleRequest() public méthode

Handles a command line request
public handleRequest ( ) : void
Résultat void

setComponentContext() public méthode

Allows to set the currently processed HTTP component chain context by the base functional test case.
See also: InternalRequestEngine::sendRequest()
public setComponentContext ( ComponentContext $context ) : void
$context Neos\Flow\Http\Component\ComponentContext
Résultat void

setHttpRequest() public méthode

Allows to set the currently processed HTTP request by the base functional test case.
Deprecation: since Flow 3.3, use setComponentContext() instead
public setHttpRequest ( Request $request ) : void
$request Neos\Flow\Http\Request
Résultat void

setHttpResponse() public méthode

Allows to set the currently processed HTTP response by the base functional test case.
Deprecation: since Flow 3.3, use setComponentContext() instead
public setHttpResponse ( Response $response ) : void
$response Neos\Flow\Http\Response
Résultat void

Property Details

$bootstrap protected_oe property

protected Bootstrap,Neos\Flow\Core $bootstrap
Résultat Neos\Flow\Core\Bootstrap

$componentContext protected_oe property

protected ComponentContext,Neos\Flow\Http\Component $componentContext
Résultat Neos\Flow\Http\Component\ComponentContext