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
ファイルを表示 Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$bootstrap Neos\Flow\Core\Bootstrap
$componentContext Neos\Flow\Http\Component\ComponentContext

Public Methods

Method 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.

Protected Methods

Method Description
getComponentContext ( ) : ComponentContext Internal getter to ensure an existing ComponentContext.

Method Details

__construct() public method

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

canHandleRequest() public method

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

getComponentContext() protected method

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

getHttpRequest() public method

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

getHttpResponse() public method

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

getPriority() public method

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

handleRequest() public method

Handles a command line request
public handleRequest ( ) : void
return void

setComponentContext() public method

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
return void

setHttpRequest() public method

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
return void

setHttpResponse() public method

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
return void

Property Details

$bootstrap protected_oe property

protected Bootstrap,Neos\Flow\Core $bootstrap
return Neos\Flow\Core\Bootstrap

$componentContext protected_oe property

protected ComponentContext,Neos\Flow\Http\Component $componentContext
return Neos\Flow\Http\Component\ComponentContext