Skip to content

3.10.0

Choose a tag to compare

@TavoNiievez TavoNiievez released this 27 Jun 01:10
· 1 commit to main since this release
558c038

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