diff --git a/tests/Notifications/EventHandlerTest.php b/tests/Notifications/EventHandlerTest.php index d7c59753..d6a968ed 100644 --- a/tests/Notifications/EventHandlerTest.php +++ b/tests/Notifications/EventHandlerTest.php @@ -51,6 +51,16 @@ Notification::assertSentTimes(BackupHasFailedNotification::class, 1); }); +test('notification contains the original exception instead of BackupFailed', function(){ + $exception = BackupFailed::from(new InvalidArgumentException('Something Went Wrong...')); + + event(new BackupHasFailed($exception->getPrevious())); + + Notification::assertSentTo(new Notifiable(), BackupHasFailedNotification::class, function ($notification) { + return $notification->event->exception instanceof InvalidArgumentException; + }); +}); + function fireBackupHasFailedEvent() { $exception = new Exception('Dummy exception');