Skip to content

Commit 5947b3e

Browse files
committed
minor #16750 Add caution message about reset container on each request (Quentin Dequippe, qdequippe)
This PR was merged into the 5.4 branch. Discussion ---------- Add caution message about reset container on each request Thanks to SymfonyCasts explication https://symfonycasts.com/screencast/api-platform-security/test-roles-reload :) Commits ------- 1898849 add break lines and remove useless line dad267e Update testing.rst c4c1899 Update testing.rst 6f431a4 Update testing.rst 4dcabf9 Add caution message about reset container on each request
2 parents 5781a94 + 1898849 commit 5947b3e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

testing.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,15 @@ This allows you to create all types of requests you can think of:
616616
:ref:`framework.test <reference-framework-test>` option is enabled).
617617
This means you can override the service entirely if you need to.
618618

619+
.. caution::
620+
621+
Before each request, the client reboots the kernel, recreating
622+
the container from scratch.
623+
This ensures that every requests are "isolated" using "new" service objects.
624+
Also, it means that entities loaded by Doctrine repositories will
625+
be "detached", so they will need to be refreshed by the manager or
626+
queried again from a repository.
627+
619628
Browsing the Site
620629
.................
621630

@@ -976,16 +985,16 @@ Response Assertions
976985
Asserts the response format returned by the
977986
:method:`Symfony\\Component\\HttpFoundation\\Response::getFormat` method
978987
is the same as the expected value.
979-
``assertResponseIsUnprocessable(string $message = '')``
988+
``assertResponseIsUnprocessable(string $message = '')``
980989
Asserts the response is unprocessable (HTTP status is 422)
981990

982991
.. versionadded:: 5.3
983992

984993
The ``assertResponseFormatSame()`` method was introduced in Symfony 5.3.
985-
994+
986995
.. versionadded:: 5.4
987996

988-
The ``assertResponseIsUnprocessable()`` method was introduced in Symfony 5.4.
997+
The ``assertResponseIsUnprocessable()`` method was introduced in Symfony 5.4.
989998

990999
Request Assertions
9911000
..................

0 commit comments

Comments
 (0)