Skip to content

Add caution message about reset container on each request #16750

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 5 commits into from
Oct 6, 2022
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
15 changes: 12 additions & 3 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,15 @@ This allows you to create all types of requests you can think of:
:ref:`framework.test <reference-framework-test>` option is enabled).
This means you can override the service entirely if you need to.

.. caution::

Before each request, the client reboots the kernel, recreating
the container from scratch.
This ensures that every requests are "isolated" using "new" service objects.
Also, it means that entities loaded by Doctrine repositories will
be "detached", so they will need to be refreshed by the manager or
queried again from a repository.

Browsing the Site
.................

Expand Down Expand Up @@ -898,16 +907,16 @@ 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 = '')``
``assertResponseIsUnprocessable(string $message = '')``
Asserts the response is unprocessable (HTTP status is 422)

.. versionadded:: 5.3

The ``assertResponseFormatSame()`` method was introduced in Symfony 5.3.

.. versionadded:: 5.4

The ``assertResponseIsUnprocessable()`` method was introduced in Symfony 5.4.
The ``assertResponseIsUnprocessable()`` method was introduced in Symfony 5.4.

Request Assertions
..................
Expand Down