diff --git a/testing/functional_tests_assertions.rst b/testing/functional_tests_assertions.rst index 68c38455741..134a8353f2a 100644 --- a/testing/functional_tests_assertions.rst +++ b/testing/functional_tests_assertions.rst @@ -19,17 +19,17 @@ Now here is the example with the assertions specific to Symfony:: $this->assertSelectorTextContains('html', 'Hello World'); -.. note:: - - These assertions only work if a request has been made with the ``Client`` - in a test case extending the ``WebTestCase`` class. - Assertions Reference --------------------- Response ~~~~~~~~ +.. note:: + + The following assertions only work if a request has been made with the + ``Client`` in a test case extending the ``WebTestCase`` class. + - ``assertResponseIsSuccessful()`` - ``assertResponseStatusCodeSame()`` - ``assertResponseRedirects()`` @@ -44,12 +44,22 @@ Response Request ~~~~~~~ +.. note:: + + The following assertions only work if a request has been made with the + ``Client`` in a test case extending the ``WebTestCase`` class. + - ``assertRequestAttributeValueSame()`` - ``assertRouteSame()`` Browser ~~~~~~~ +.. note:: + + The following assertions only work if a request has been made with the + ``Client`` in a test case extending the ``WebTestCase`` class. + - ``assertBrowserHasCookie()`` - ``assertBrowserNotHasCookie()`` - ``assertBrowserCookieValueSame()`` @@ -59,8 +69,9 @@ Crawler .. note:: - You cannot use the :doc:`Crawler ` assertions, - when using `symfony/panther`_ for end-to-end testing. + The following assertions only work if a request has been made with the + ``Client`` in a test case extending the ``WebTestCase`` class. In addition, + they are not available when using `symfony/panther`_ for end-to-end testing. - ``assertSelectorExists()`` - ``assertSelectorNotExists()`` @@ -75,6 +86,11 @@ Crawler Mailer ~~~~~~ +.. versionadded:: 5.1 + + 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()`` - ``assertQueuedEmailCount()`` - ``assertEmailIsQueued()``
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: