GitHub

3.10.1

3.10.0

Minor release featuring two new assertion trait groups, Symfony 8.1 test support, plus DX, performance, and bug fixes.

🚀 New Features

Messenger Assertions

Introduced MessengerAssertionsTrait for testing dispatched messages ([#241]):

  • seeMessageDispatched()
  • dontSeeMessageDispatched()
  • seeDispatchedMessageCount()
  • grabDispatchedMessageClasses()

Symfony-Inherited Assertions

Ported directly from Symfony's own test helpers ([#240]):

  • Browser: assertBrowserHistoryIsOnFirstPage(), assertBrowserHistoryIsNotOnFirstPage(), assertBrowserHistoryIsOnLastPage(), assertBrowserHistoryIsNotOnLastPage()
  • DomCrawler: assertSelectorCount(), assertAnySelectorTextContains(), assertAnySelectorTextSame(), assertAnySelectorTextNotContains()
  • Mailer: getMailerEvents(), getMailerMessages(), getMailerMessage()
  • Mime: assertEmailAddressNotContains(), assertEmailSubjectContains(), assertEmailSubjectNotContains()

🔄 Changed

Mail/Mime Assertions Refactor

Assertions now operate on RawMessage instead of Email to support any sent message type ([#232]):

  • grabLastSentEmail() return type widened from ?Email to ?RawMessage.
  • assertEmailAddressContains(), assertEmailHasHeader(), assertEmailNotHasHeader(), assertEmailHeaderSame(), and assertEmailHeaderNotSame() now accept ?Message instead of ?Email.

⚠️ Important Runtime Note:
The object returned by grabLastSentEmail() remains an Email instance at runtime, but its declared type is now the wider RawMessage. If your tests rely on Email-specific methods (like ->getTo() or ->getSubject()), you must explicitly narrow the type using instanceof Email or a type cast. Alternatively, migrate to the new assertEmailSubjectContains() or header assertions where possible.

Quality of Life & Performance

  • Improved DX, type safety, and performance across all assertion traits by adding/tightening type hints and reducing redundant operations in hot paths. ([#235], [#234])

🐛 Fixed

  • Doctrine: Fixed missing security context in Doctrine entity listeners after a kernel reboot. ([#236])
  • Profiler: Fixed profiler service deprecation by switching to the non-deprecated internal service ID. ([#237])

🛠️ Maintenance

  • Added Symfony 8.1 to the test matrix and included symfony/messenger as an unchanged dev dependency. ([#243])
  • Applied the 7.4 reset-formats patch using GNU patch (fuzz) and pinned codeception/module-rest to ^3.4 in the functional suite. ([#242])

🤝 New Contributors

Full Changelog: 3.9.1...3.10.0

3.9.2

3.9.1

3.9.0

3.8.0

3.7.1

3.7.0

What's Changed

  • Module code adapted for PHPStan in #213
  • Update to Symfony 7.3 in #214

Full Changelog: 3.6.0...3.7.0

3.6.0

3.5.1

What's Changed

Support Symfony 7.2 (#203).
Added Symfony Translation assertions (#205):

  • dontSeeFallbackTranslations
  • dontSeeMissingTranslations
  • grabDefinedTranslationsCount
  • seeAllTranslationsDefined
  • seeDefaultLocaleIs
  • seeFallbackLocalesAre
  • seeFallbackTranslationsCountLessThan
  • seeMissingTranslationsCountLessThan

Added Symfony Logger assertion (dontSeeDeprecations) (#206).

Full Changelog: 3.5.0...3.5.1

Read the original on github.com ↗