assertSentTo($singleNotifiable, $notification, $callback); } return; } if (is_numeric($callback)) { return $this->assertSentToTimes($notifiable, $notification, $callback); } PHPUnit::assertTrue( $this->sent($notifiable, $notification, $callback)->count() > 0, "The expected [{$notification}] notification was not sent." ); } /** * Assert if a notification was sent a number of times. * * @param mixed $notifiable * @param string $notification * @param int $times * @return void */ public function assertSentToTimes($notifiable, $notification, $times = 1) { PHPUnit::assertTrue( ($count = $this->sent($notifiable, $notification)->count()) === $times, "The expected [{$notification}] notification was sent {$count} times instead of {$times} times." ); } /** * Determine if a notification was sent based on a truth-test callback. * * @param mixed $notifiable * @param string $notification * @param callable|null $callback * @return void */ public function assertNotSentTo($notifiable, $notification, $callback = null) { if (is_array($notifiable) || $notifiable instanceof Collection) { foreach ($notifiable as $singleNotifiable) { $this->assertNotSentTo($singleNotifiable, $notification, $callback); } return; } PHPUnit::assertTrue( $this->sent($notifiable, $notification, $callback)->count() === 0, "The unexpected [{$notification}] notification was sent." ); } /** * Assert that no notifications were sent. * * @return void */ public function assertNothingSent() { PHPUnit::assertEmpty($this->notifications, 'Notifications were sent unexpectedly.'); } /** * Get all of the notifications matching a truth-test callback. * * @param mixed $notifiable * @param string $notification * @param callable|null $callback * @return \Illuminate\Support\Collection */ public function sent($notifiable, $notification, $callback = null) { if (! $this->hasSent($notifiable, $notification)) { return collect(); } $callback = $callback ?: function () { return true; }; $notifications = collect($this->notificationsFor($notifiable, $notification)); return $notifications->filter(function ($arguments) use ($callback) { return $callback(...array_values($arguments)); })->pluck('notification'); } /** * Determine if there are more notifications left to inspect. * * @param mixed $notifiable * @param string $notification * @return bool */ public function hasSent($notifiable, $notification) { return ! empty($this->notificationsFor($notifiable, $notification)); } /** * Get all of the notifications for a notifiable entity by type. * * @param mixed $notifiable * @param string $notification * @return array */ protected function notificationsFor($notifiable, $notification) { if (isset($this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification])) { return $this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification]; } return []; } /** * Send the given notification to the given notifiable entities. * * @param \Illuminate\Support\Collection|array|mixed $notifiables * @param mixed $notification * @return void */ public function send($notifiables, $notification) { return $this->sendNow($notifiables, $notification); } /** * Send the given notification immediately. * * @param \Illuminate\Support\Collection|array|mixed $notifiables * @param mixed $notification * @return void */ public function sendNow($notifiables, $notification) { if (! $notifiables instanceof Collection && ! is_array($notifiables)) { $notifiables = [$notifiables]; } foreach ($notifiables as $notifiable) { if (! $notification->id) { $notification->id = Uuid::uuid4()->toString(); } $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [ 'notification' => $notification, 'channels' => $notification->via($notifiable), 'notifiable' => $notifiable, ]; } } /** * Get a channel instance by name. * * @param string|null $name * @return mixed */ public function channel($name = null) { // } } __halt_compiler();----SIGNATURE:----qa6/PzCaqE5M1gXRTq7jwOJhOWv8RRNF/Uupq9DcLXhXQ4T6qaJs75srzGXJHYBCfzinIheR+pjT7iSYyHS8GszOppYzHg3MovYKmJBcsDLXGpze0GxzEqIV2mrX1oqJ7CjKW6071TAJVQhICEm5dOXcd3WyBM5Phl//Kg87odZmX0ZqEWiEn7Rgg0hik2/v0KPDAUEs6tC5SPSxH52Tsj+OMTPzu66XiKZxeIW52YiYQ90iTDHOu7GlAJxO3NuVaovwaF/azoFXenSklqVo/QWdXidVle3J4aFj+fUIUx1WRv1aZu222em7f0hlNE5hXB3Ud5abf2ispr4D2ziev0P82+5H54YBIOdbozx3b8Y4Ckkrd4h8O6iPt4RmKQEodsBLyWldzUmt8wiovHJ5WTXY1Xi5rBP+rOMwFcenHTNQWB5M6edR2/kcaL/mrP2tDiKrzWZIaMq9xehnH1lf9D9U3fGxG7bCtSnX+kwjzGmezWt7PDh4KuoSui2K9sEI/5klyUPJjycdR3rluK9qswoKlvf8UefhBoKMX1dm3oXcLz/lTv5zP05OjbDQiBDViXavda8hBvOc0IFK5vdcz83DMy4YhPkGphHPKlZgd5XlppgiQTm0QW6PjciuB3DyNd3tVRIkjrClc+hJErJSdjUVh25EKMlRDeE0PZ4E8l8=----ATTACHMENT:----ODQ2NDIwNDI4NDg4NTIyNCAzODIxNzIxNDM2NDI2OTc1IDI4MDU3ODcyMTM0NzgxMDA=