Skip to content

Commit e264aae

Browse files
committed
fix notification fake for arrays
1 parent cb1286e commit e264aae

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Testing/Fakes/NotificationFake.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ class NotificationFake implements NotificationFactory
2626
*/
2727
public function assertSentTo($notifiable, $notification, $callback = null)
2828
{
29+
if (is_array($notifiable) || $notifiable instanceof Collection) {
30+
foreach ($notifiable as $singleNotifiable) {
31+
$this->assertSentTo($singleNotifiable, $notification, $callback);
32+
}
33+
34+
return;
35+
}
36+
2937
PHPUnit::assertTrue(
3038
$this->sent($notifiable, $notification, $callback)->count() > 0,
3139
"The expected [{$notification}] notification was not sent."
@@ -42,6 +50,14 @@ public function assertSentTo($notifiable, $notification, $callback = null)
4250
*/
4351
public function assertNotSentTo($notifiable, $notification, $callback = null)
4452
{
53+
if (is_array($notifiable) || $notifiable instanceof Collection) {
54+
foreach ($notifiable as $singleNotifiable) {
55+
$this->assertNotSentTo($singleNotifiable, $notification, $callback);
56+
}
57+
58+
return;
59+
}
60+
4561
PHPUnit::assertTrue(
4662
$this->sent($notifiable, $notification, $callback)->count() === 0,
4763
"The unexpected [{$notification}] notification was sent."

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy