HttpAssert
class HttpAssert
HTTP testing helpers.
Methods
Sends an HTTP request and returns an HttpAssert instance for chaining assertions.
Asserts that the HTTP response code matches the expectation.
Asserts that the HTTP response code does not match the expectation.
Asserts that a response header exists and optionally matches the expectation.
Asserts that a response header does not exist or does not match the expectation.
Asserts that the response body matches the expectation.
Asserts that the response body does not match the expectation.
Details
at line 32
static HttpAssert
fetch(string $url, string $method = 'GET', array $headers = [], array $cookies = [], bool $follow = false, string|null $body = null)
Sends an HTTP request and returns an HttpAssert instance for chaining assertions.
at line 99
HttpAssert
expectCode(int|Closure $expected)
Asserts that the HTTP response code matches the expectation.
at line 115
HttpAssert
denyCode(int|Closure $expected)
Asserts that the HTTP response code does not match the expectation.
at line 131
HttpAssert
expectHeader(string $name, string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts that a response header exists and optionally matches the expectation.
at line 159
HttpAssert
denyHeader(string $name, string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts that a response header does not exist or does not match the expectation.
at line 191
HttpAssert
expectBody(string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts that the response body matches the expectation.
at line 215
HttpAssert
denyBody(string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts that the response body does not match the expectation.