Skip to content

[Testing] Documented the changes in MailerAssertionsTrait #13050

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
Mar 12, 2020
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
30 changes: 23 additions & 7 deletions testing/functional_tests_assertions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()``
Expand All @@ -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()``
Expand All @@ -59,8 +69,9 @@ Crawler

.. note::

You cannot use the :doc:`Crawler </components/dom_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()``
Expand All @@ -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()``
Expand Down