Skip to content

[Testing] Update nullable types #19786

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
Apr 15, 2024
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
20 changes: 10 additions & 10 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,12 @@
The full signature of the ``request()`` method is::

request(
string $method,

Check failure on line 604 in testing.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[PHP syntax] Syntax error, unexpected T_VARIABLE, expecting ')'
string $uri,
array $parameters = [],

Check failure on line 606 in testing.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[PHP syntax] Syntax error, unexpected ','
array $files = [],

Check failure on line 607 in testing.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[PHP syntax] Syntax error, unexpected ','
array $server = [],

Check failure on line 608 in testing.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[PHP syntax] Syntax error, unexpected ','
string $content = null,
?string $content = null,

Check failure on line 609 in testing.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[PHP syntax] Syntax error, unexpected ','
bool $changeHistory = true
): Crawler

Expand Down Expand Up @@ -1007,18 +1007,18 @@
Asserts that the response was successful (HTTP status is 2xx).
``assertResponseStatusCodeSame(int $expectedCode, string $message = '')``
Asserts a specific HTTP status code.
``assertResponseRedirects(string $expectedLocation = null, int $expectedCode = null, string $message = '')``
``assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '')``
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, 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, 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 = '')``
``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).
``assertResponseCookieValueSame(string $name, string $expectedValue, string $path = '/', string $domain = null, string $message = '')``
``assertResponseCookieValueSame(string $name, string $expectedValue, string $path = '/', ?string $domain = null, string $message = '')``
Asserts the given cookie is present and set to the expected value.
``assertResponseFormatSame(?string $expectedFormat, string $message = '')``
Asserts the response format returned by the
Expand Down Expand Up @@ -1047,10 +1047,10 @@
Browser Assertions
..................

``assertBrowserHasCookie(string $name, string $path = '/', string $domain = null, string $message = '')``/``assertBrowserNotHasCookie(string $name, string $path = '/', string $domain = null, string $message = '')``
``assertBrowserHasCookie(string $name, string $path = '/', ?string $domain = null, string $message = '')``/``assertBrowserNotHasCookie(string $name, string $path = '/', ?string $domain = null, string $message = '')``
Asserts that the test Client does (not) have the given cookie set
(meaning, the cookie was set by any response in the test).
``assertBrowserCookieValueSame(string $name, string $expectedValue, string $path = '/', string $domain = null, string $message = '')``
``assertBrowserCookieValueSame(string $name, string $expectedValue, string $path = '/', ?string $domain = null, string $message = '')``
Asserts the given cookie in the test Client is set to the expected
value.
``assertThatForClient(Constraint $constraint, string $message = '')``
Expand Down Expand Up @@ -1108,18 +1108,18 @@
Starting from Symfony 5.1, the following assertions no longer require to make
a request with the ``Client`` in a test case extending the ``WebTestCase`` class.

``assertEmailCount(int $count, string $transport = null, string $message = '')``
``assertEmailCount(int $count, ?string $transport = null, string $message = '')``
Asserts that the expected number of emails was sent.
``assertQueuedEmailCount(int $count, string $transport = null, string $message = '')``
``assertQueuedEmailCount(int $count, ?string $transport = null, string $message = '')``
Asserts that the expected number of emails was queued (e.g. using the
Messenger component).
``assertEmailIsQueued(MessageEvent $event, string $message = '')``/``assertEmailIsNotQueued(MessageEvent $event, string $message = '')``
Asserts that the given mailer event is (not) queued. Use
``getMailerEvent(int $index = 0, string $transport = null)`` to
``getMailerEvent(int $index = 0, ?string $transport = null)`` to
retrieve a mailer event by index.
``assertEmailAttachmentCount(RawMessage $email, int $count, string $message = '')``
Asserts that the given email has the expected number of attachments. Use
``getMailerMessage(int $index = 0, string $transport = null)`` to
``getMailerMessage(int $index = 0, ?string $transport = null)`` to
retrieve a specific email by index.
``assertEmailTextBodyContains(RawMessage $email, string $text, string $message = '')``/``assertEmailTextBodyNotContains(RawMessage $email, string $text, string $message = '')``
Asserts that the text body of the given email does (not) contain the
Expand Down
Loading