From 08935ff33b022d4004ae19d02a0b3c4144540ebb Mon Sep 17 00:00:00 2001 From: Mikko Ala-Fossi Date: Fri, 5 Aug 2022 17:49:20 +0300 Subject: [PATCH] Update NotificationFake with notifications getter (#43558) When testing notifications this is super handy for testing whether the correct notifications have been sent. Similar method is available in the QueueFake with `Queue::getJobs()` --- .../Support/Testing/Fakes/NotificationFake.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php index 0a19ed74e41..b6065ceac17 100644 --- a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php +++ b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php @@ -348,4 +348,14 @@ public function locale($locale) return $this; } + + /** + * Get the notifications that have been sent. + * + * @return array + */ + public function sentNotifications() + { + return $this->notifications; + } }