From a90f0cd9a01bf62706e8ea7ef9bbd2568775a5bb Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 26 Sep 2025 12:58:27 +0200 Subject: [PATCH] [BrowserKit] Add a note about making multiple requests --- components/browser_kit.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/browser_kit.rst b/components/browser_kit.rst index 21ceaf5a095..7ff36393122 100644 --- a/components/browser_kit.rst +++ b/components/browser_kit.rst @@ -69,6 +69,12 @@ The value returned by the ``request()`` method is an instance of the :doc:`DomCrawler component `, which allows accessing and traversing HTML elements programmatically. +.. note:: + + After making a request, subsequent requests will make the client to + reboot the kernel. This clears the security token, detaches Doctrine + entities, etc. Read more about :ref:`making multiple requests in the same test`. + The :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::jsonRequest` method, which defines the same arguments as the ``request()`` method, is a shortcut to convert the request parameters into a JSON string and set the needed HTTP headers::