From 6cb74182a232461400161c9993141f77992d77aa 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 3a36339b7fb..5991420d334 100644 --- a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php +++ b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php @@ -362,4 +362,14 @@ public function locale($locale) return $this; } + + /** + * Get the notifications that have been sent. + * + * @return array + */ + public function sentNotifications() + { + return $this->notifications; + } }