HttpAssert
class HttpAssert
HTTP testing helpers.
Methods
Creates HTTP request, executes it and returns HttpTest instance for chaining expectations.
Asserts HTTP response code matches expectation.
Asserts HTTP response code does not match expectation.
Asserts HTTP response header matches expectation.
Asserts HTTP response header does not match expectation.
Asserts HTTP response body matches expectation.
Asserts HTTP response body does not match expectation.
Details
at line 31
static HttpAssert
fetch(string $url, string $method = 'GET', array $headers = [], array $cookies = [], bool $follow = false, string|null $body = null)
Creates HTTP request, executes it and returns HttpTest instance for chaining expectations.
at line 98
HttpAssert
expectCode(int|Closure $expected)
Asserts HTTP response code matches expectation.
at line 113
HttpAssert
denyCode(int|Closure $expected)
Asserts HTTP response code does not match expectation.
at line 128
HttpAssert
expectHeader(string $name, string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts HTTP response header matches expectation.
at line 155
HttpAssert
denyHeader(string $name, string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts HTTP response header does not match expectation.
at line 186
HttpAssert
expectBody(string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts HTTP response body matches expectation.
at line 209
HttpAssert
denyBody(string|Closure|null $expected = null, string|null $contains = null, string|null $matches = null)
Asserts HTTP response body does not match expectation.