Skip to content

Add Messenger functional tests (5.4)#56

Merged
TavoNiievez merged 4 commits into
Codeception:5.4from
TavoNiievez:messenger-assertions-5.4
Jun 25, 2026
Merged

Add Messenger functional tests (5.4)#56
TavoNiievez merged 4 commits into
Codeception:5.4from
TavoNiievez:messenger-assertions-5.4

Conversation

@TavoNiievez

@TavoNiievez TavoNiievez commented Jun 25, 2026

Copy link
Copy Markdown
Member

Companion to Codeception/module-symfony#241 (adds MessengerAssertionsTrait).

What

Adds tests/Functional/MessengerCest.php exercising the new Messenger steps end-to-end:

  • seeDispatchedMessageCount(int, ?bus)
  • seeMessageDispatched(class, ?bus) / dontSeeMessageDispatched(class, ?bus)
  • grabDispatchedMessageClasses(?bus)

App changes

  • Adds symfony/messenger and enables it with a single synchronous default bus (messenger.bus.default).
  • Adds a sample SendWelcomeMessage, its handler, and a /dispatch-message controller/route the Cest hits.
  • Sets mailer.message_bus: false so enabling Messenger does not route Mailer through the bus (which would otherwise double-count messages and break MailerCest).

Same change as the 7.4 PR (#53); validated there with MessengerCest 5/5 and MailerCest/NotifierCest green.

CI is red until the module PR merges

These steps live in codeception/module-symfony (PR #241), which is not yet released. The app installs the module via dev-main, so FunctionalTester does not expose seeDispatchedMessageCount / seeMessageDispatched / dontSeeMessageDispatched / grabDispatchedMessageClasses yet — the Call to undefined method ... failures are expected pre-merge. Once #241 is merged to main, refreshing the lock (composer update codeception/module-symfony) makes this branch green.

Add a MessengerCest covering the new Messenger assertions from
codeception/module-symfony: assertMessageCount, seeMessageDispatched,
dontSeeMessageDispatched and grabDispatchedMessageClasses.

Enable Symfony Messenger in the test app (symfony/messenger + a default
synchronous bus) with a sample message, handler and dispatch route, and
keep the Mailer synchronous (mailer.message_bus: false) so the existing
MailerCest is unaffected.
@TavoNiievez TavoNiievez changed the title Add Messenger functional tests Add Messenger functional tests (5.4) Jun 25, 2026
Refresh codeception/module-symfony dev-main (7d9317f -> 7f0cd5d) so the
Messenger steps are available; MessengerCest passes against the merged module.
@TavoNiievez TavoNiievez merged commit e3d4545 into Codeception:5.4 Jun 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant