Skip to content

Commit 497fb5d

Browse files
committed
[Notifier][Testing] Document the notifier assertions
1 parent 10706e8 commit 497fb5d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

testing.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,36 @@ Mailer Assertions
970970
address. This assertion normalizes addresses like ``Jane Smith
971971
<jane@example.com>`` into ``jane@example.com``.
972972

973+
Notifier Assertions
974+
...................
975+
976+
``assertNotificationCount(int $count, string $transportName = null, string $message = '')``
977+
Asserts that the given number of notifications has been created
978+
(in total or for the given transport).
979+
``assertQueuedNotificationCount(int $count, string $transportName = null, string $message = '')``
980+
Asserts that the given number of notifications are queued
981+
(in total or for the given transport).
982+
``assertNotificationIsQueued(MessageEvent $event, string $message = '')``
983+
Asserts that the given notification is queued.
984+
``assertNotificationIsNotQueued(MessageEvent $event, string $message = '')``
985+
Asserts that the given notification is not queued.
986+
``assertNotificationSubjectContains(MessageInterface $notification, string $text, string $message = '')``
987+
Asserts that the given text is included in the subject of
988+
the given notification.
989+
``assertNotificationSubjectNotContains(MessageInterface $notification, string $text, string $message = '')``
990+
Asserts that the given text is not included in the subject of
991+
the given notification.
992+
``assertNotificationTransportIsEqual(MessageInterface $notification, string $transportName, string $message = '')``
993+
Asserts that the name of the transport for the given notification
994+
is the same as the given text.
995+
``assertNotificationTransportIsNotEqual(MessageInterface $notification, string $transportName, string $message = '')``
996+
Asserts that the name of the transport for the given notification
997+
is not the same as the given text.
998+
999+
.. versionadded:: 6.2
1000+
1001+
The Notifier assertions were introduced in Symfony 6.2.
1002+
9731003
.. TODO
9741004
.. End to End Tests (E2E)
9751005
.. ----------------------

0 commit comments

Comments
 (0)