NotificationCount example

use Symfony\Component\Notifier\Event\NotificationEvents;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Test\Constraint as NotifierConstraint;

/* * @author Smaïne Milianni <smaine.milianni@gmail.com> */
trait NotificationAssertionsTrait
{
    public static function assertNotificationCount(int $count, string $transportName = null, string $message = ''): void
    {
        self::assertThat(self::getNotificationEvents()new NotifierConstraint\NotificationCount($count$transportName)$message);
    }

    public static function assertQueuedNotificationCount(int $count, string $transportName = null, string $message = ''): void
    {
        self::assertThat(self::getMessageMailerEvents()new NotifierConstraint\NotificationCount($count$transportName, true)$message);
    }

    public static function assertNotificationIsQueued(MessageEvent $event, string $message = ''): void
    {
        self::assertThat($eventnew NotifierConstraint\NotificationIsQueued()$message);
    }

    
Home | Imprint | This part of the site doesn't use cookies.