FakeResponse
class FakeResponse implements FakeResponse
Traits
Properties
| protected BodyRepository | $body | The response body. |
|
| protected null|Throwable | $responseException | The configured exception resolver. |
Methods
static static
make(array|string $body = '[]', int $status = '200', array<string $, mixed> $headers = '[]')
No description
__construct(array|string $body = [], int $status = 200, array $headers = [])
Create a fake response.
body()
Get the response body repository.
int
status()
Get the response status.
array
headers()
Get the response headers.
Throwable|null
ResponseInterface
createPsrResponse()
Create the PSR response.
Details
at line 22
static static
make(array|string $body = '[]', int $status = '200', array<string $, mixed> $headers = '[]')
No description
at line 44
__construct(array|string $body = [], int $status = 200, array $headers = [])
Create a fake response.
at line 57
BodyRepository
body()
Get the response body repository.
at line 65
int
status()
Get the response status.
at line 75
array
headers()
Get the response headers.
at line 85
FakeResponse
throw(Closure|Throwable $value)
Configure an exception for the request.
at line 97
Throwable|null
getException(PendingRequest $pendingRequest)
Resolve the configured exception.
at line 107
static Fixture
fixture(string $name)
Create a fake response from a fixture.
at line 115
ResponseInterface
createPsrResponse()
Create the PSR response.