Skip to content

Conversation

@innocenzi
Copy link
Member

@innocenzi innocenzi commented Dec 29, 2025

Closes #1486

This pull request adds a new recordEventDispatches in addition to the existing preventEventHandling. Recording event dispatches swaps to the testing event bus but doesn't prevent dispatches, so assertions are possible.

$this->eventBus->recordEventDispatches();

// ...

$this->eventBus->assertDispatched(FakeEvent::class);

Adding @WendellAdriel as a co-author for his initial work on this in me@wendelladriel.com

Co-authored-by: Wendell Adriel me@wendelladriel.com

@innocenzi innocenzi changed the title feat(event-bus): allow event assertions without preventing their execution feat(event-bus): allow assertions without preventing event execution Dec 29, 2025
@innocenzi innocenzi merged commit ea48a8a into 3.x Dec 29, 2025
76 checks passed
@innocenzi innocenzi deleted the feat/event-testing branch December 29, 2025 22:39
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.

2 participants