From 8d2d3a7e35526ca687653f9db7836592869dec25 Mon Sep 17 00:00:00 2001 From: Joel Male Date: Fri, 17 Nov 2023 09:41:19 +1000 Subject: [PATCH 1/2] [10.x] Fix notifications being counted as sent without a "shouldSend" method --- src/Illuminate/Support/Testing/Fakes/NotificationFake.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php index 12794711b091..7d0f32f56c2b 100644 --- a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php +++ b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php @@ -307,9 +307,10 @@ public function sendNow($notifiables, $notification, array $channels = null) fn ($channel) => $notification->shouldSend($notifiable, $channel) !== false ); - if (empty($notifiableChannels)) { - continue; - } + } + + if (empty($notifiableChannels)) { + continue; } $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [ From 6506332686229e686d734ae32ce3b963278c0d27 Mon Sep 17 00:00:00 2001 From: Joel Male Date: Fri, 17 Nov 2023 09:58:51 +1000 Subject: [PATCH 2/2] Fix style issue --- src/Illuminate/Support/Testing/Fakes/NotificationFake.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php index 7d0f32f56c2b..df00c465ff3c 100644 --- a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php +++ b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php @@ -306,7 +306,6 @@ public function sendNow($notifiables, $notification, array $channels = null) $notifiableChannels, fn ($channel) => $notification->shouldSend($notifiable, $channel) !== false ); - } if (empty($notifiableChannels)) {