Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[14.x] Update Notification::fake() to respect job middleware#60233

Open
ziadoz wants to merge 6 commits into
laravel:masterfrom
ziadoz:notification-job-middleware
Open

[14.x] Update Notification::fake() to respect job middleware#60233
ziadoz wants to merge 6 commits into
laravel:masterfrom
ziadoz:notification-job-middleware

Conversation

@ziadoz
Copy link
Copy Markdown
Contributor

@ziadoz ziadoz commented May 22, 2026

I was writing some notifications tests today, and I got tripped up by Notification::fake(), as it doesn't respect any middleware on the notification job.

I've adjusted NotificationFake so it now pipes the job through its middleware to determine if it would have been sent to the applicable channels.

Did this 14.x because technically it's a breaking change, but I think the current behaviour of having notification middleware ignored can be confusing.

@github-actions
Copy link
Copy Markdown

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@ziadoz ziadoz force-pushed the notification-job-middleware branch from b14e5da to 636a81b Compare May 22, 2026 12:25
@ziadoz
Copy link
Copy Markdown
Contributor Author

ziadoz commented May 22, 2026

I think the CI failures here are unrelated:

❯ php vendor/bin/phpunit --filter=SupportTestingNotificationFakeTest
PHPUnit 13.1.11 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.20
Configuration: /Users/ziadoz/Projects/laravel-framework/phpunit.xml.dist

....................                                              20 / 20 (100%)

Time: 00:00.795, Memory: 191.00 MB

OK (20 tests, 34 assertions)```

@ziadoz ziadoz marked this pull request as ready for review May 22, 2026 14:20
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