class RecordedResponse implements JsonSerializable

Methods

__construct(int $statusCode, array $headers = [], string $data = '', array $context = [])

Create a recorded response.

fromFile(string $contents)

Create a recorded response from fixture contents.

fromResponse(Response $response)

Create a recorded response from a Saloon response.

string
toFile()

Encode the response for fixture storage.

toMockResponse()

Create a mock response from the recorded value.

array
jsonSerialize()

Convert the recorded response to its fixture representation.

Details

at line 20
__construct(int $statusCode, array $headers = [], string $data = '', array $context = [])

Create a recorded response.

Parameters

int $statusCode
array $headers
string $data
array $context

at line 31
static RecordedResponse fromFile(string $contents)

Create a recorded response from fixture contents.

Parameters

string $contents

Return Value

RecordedResponse

at line 58
static RecordedResponse fromResponse(Response $response)

Create a recorded response from a Saloon response.

Parameters

Response $response

Return Value

RecordedResponse

at line 70
string toFile()

Encode the response for fixture storage.

Return Value

string

at line 78
MockResponse toMockResponse()

Create a mock response from the recorded value.

Return Value

MockResponse

at line 88
array jsonSerialize()

Convert the recorded response to its fixture representation.

Return Value

array