SapiMock
extends Sapi
in package
HTTP Response Mock object.
This class exists to make the transition to sabre/http easier.
Tags
Table of Contents
- $sent : mixed
- createFromServerArray() : Request
- This static method will create a new Request object, based on a PHP $_SERVER array.
- getRequest() : Request
- This static method will create a new Request object, based on the current PHP request.
- sendResponse() : mixed
- Overriding this so nothing is ever echo'd.
Properties
$sent
public
static mixed
$sent
= 0
Methods
createFromServerArray()
This static method will create a new Request object, based on a PHP $_SERVER array.
public
static createFromServerArray(array<string|int, mixed> $serverArray) : Request
REQUEST_URI and REQUEST_METHOD are required.
Parameters
- $serverArray : array<string|int, mixed>
Return values
Request —getRequest()
This static method will create a new Request object, based on the current PHP request.
public
static getRequest() : Request
Return values
Request —sendResponse()
Overriding this so nothing is ever echo'd.
public
static sendResponse(ResponseInterface $response) : mixed
Parameters
- $response : ResponseInterface