interface FakeResponse

Methods

int
status()

Get the response status.

array
headers()

Get the response headers.

body()

Get the response body repository.

throw(Closure|Throwable $value)

Configure an exception for the request.

Throwable|null
getException(PendingRequest $pendingRequest)

Resolve the configured exception.

static Fixture
fixture(string $name)

Create a fake response from a fixture.

ResponseInterface
createPsrResponse()

Create the PSR response.

Details

at line 19
int status()

Get the response status.

Return Value

int

at line 26
array headers()

Get the response headers.

Return Value

array

at line 31
BodyRepository body()

Get the response body repository.

Return Value

BodyRepository

at line 38
FakeResponse throw(Closure|Throwable $value)

Configure an exception for the request.

Parameters

Closure|Throwable $value

Return Value

FakeResponse

at line 43
Throwable|null getException(PendingRequest $pendingRequest)

Resolve the configured exception.

Parameters

PendingRequest $pendingRequest

Return Value

Throwable|null

at line 48
static Fixture fixture(string $name)

Create a fake response from a fixture.

Parameters

string $name

Return Value

Fixture

at line 53
ResponseInterface createPsrResponse()

Create the PSR response.

Return Value

ResponseInterface