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