Skip to content

[Testing] Response Assertions: add examples of headers #18553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -971,10 +971,10 @@ Response Assertions
Asserts the response is a redirect response (optionally, you can check
the target location and status code).
``assertResponseHasHeader(string $headerName, string $message = '')``/``assertResponseNotHasHeader(string $headerName, string $message = '')``
Asserts the given header is (not) available on the response.
Asserts the given header is (not) available on the response, e.g. ``assertResponseHasHeader('content-type');``.
``assertResponseHeaderSame(string $headerName, string $expectedValue, string $message = '')``/``assertResponseHeaderNotSame(string $headerName, string $expectedValue, string $message = '')``
Asserts the given header does (not) contain the expected value on the
response.
response, e.g. ``assertResponseHeaderSame('content-type', 'application/octet-stream');``.
``assertResponseHasCookie(string $name, string $path = '/', string $domain = null, string $message = '')``/``assertResponseNotHasCookie(string $name, string $path = '/', string $domain = null, string $message = '')``
Asserts the given cookie is present in the response (optionally
checking for a specific cookie path or domain).
Expand Down