Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] allow to unverbose all the methods in BrowserKitAssertionsTrait #21103

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
Jun 25, 2025
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
17 changes: 13 additions & 4 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -963,11 +963,11 @@ However, Symfony provides useful shortcut methods for the most common cases:
Response Assertions
...................

``assertResponseIsSuccessful(string $message = '', bool $verbose = true)``
``assertResponseIsSuccessful(string $message = '', ?bool $verbose = null)``
Asserts that the response was successful (HTTP status is 2xx).
``assertResponseStatusCodeSame(int $expectedCode, string $message = '', bool $verbose = true)``
``assertResponseStatusCodeSame(int $expectedCode, string $message = '', ?bool $verbose = null)``
Asserts a specific HTTP status code.
``assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '', bool $verbose = true)``
``assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '', ?bool $verbose = null)``
Asserts the response is a redirect response (optionally, you can check
the target location and status code). The excepted location can be either
an absolute or a relative path.
Expand All @@ -985,13 +985,22 @@ Response Assertions
Asserts the response format returned by the
:method:`Symfony\\Component\\HttpFoundation\\Response::getFormat` method
is the same as the expected value.
``assertResponseIsUnprocessable(string $message = '', bool $verbose = true)``
``assertResponseIsUnprocessable(string $message = '', bool ?$verbose = null)``
Asserts the response is unprocessable (HTTP status is 422)

.. versionadded:: 7.1

The ``$verbose`` parameters were introduced in Symfony 7.1.

.. versionadded:: 7.4

The ``$defaultVerboseMode = true;`` attribute was introduced in
:class:`Symfony\\Bundle\\FrameworkBundle\\Test\\BrowserKitAssertionsTrait`
in Symfony 7.4. This attribute allows you to define the default verbosity
for all applicable assertions within the trait, overriding the initial `null`
value of the `$verbose` parameter.


Request Assertions
..................

Expand Down