Fix : notification filter test correct config key and assertion #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test was passing by accident due to two bugs that masked each other:
Wrong config key: Used 'failed-job-monitor.callback' instead of 'failed-job-monitor.notificationFilter', causing the filter to never execute (config returned null, is_callable(null) = false, so default behavior sent notification).
Wrong notification class: Asserted that AnotherNotification::class was not sent, but the default notification class is Notification::class. Since the filter didn't run, Notification::class was sent, and the test checked for AnotherNotification::class (which wasn't sent), so it passed incorrectly.
The test appeared to work but wasn't actually validating the filter functionality. When the filter should return false (empty exception message), the notification should not be sent, but the test wasn't verifying this correctly.
Changes:
Now the test properly validates that when notificationFilter returns false, no notification is sent to the default Notifiable with the
default Notification class.