Skip to content

Provide Behat and Cypress API for testing emails sent by the Symfony Mailer.

License

Notifications You must be signed in to change notification settings

Kocal/SymfonyMailerTesting

Repository files navigation

Symfony Mailer Testing

Package version PHP supported versions Symfony supported version License CI

Test emails sent by the Symfony Mailer with Behat and Cypress.

This testing library provides the same PHPUnit assertions for Email Messages from Symfony, but for Behat and Cypress:

  • assertEmailCount
  • assertQueuedEmailCount
  • assertEmailIsQueued
  • assertEmailIsNotQueued
  • assertEmailAttachmentCount
  • assertEmailTextBodyContains
  • assertEmailTextBodyNotContains
  • assertEmailHtmlBodyContains
  • assertEmailHtmlBodyNotContains
  • assertEmailHasHeader
  • assertEmailNotHasHeader
  • assertEmailHeaderSame
  • assertEmailHeaderNotSame
  • assertEmailAddressContains

With additional assertions:

  • assertEmailSubjectSame
  • assertEmailSubjectContains
  • assertEmailSubjectMatches
  • assertEmailTextBodyMatches
  • assertEmailTextBodyNotMatches
  • assertEmailHtmlBodyMatches
  • assertEmailHtmlBodyNotMatches
  • assertEmailAttachmentNameSame
  • assertEmailAttachmentNameMatches

Documentation

The documentation can be found at ./docs.