diff --git a/tests/Feature/Notifications/NotificationTest.php b/tests/Feature/Notifications/NotificationTest.php index ce27b787..a4fb6688 100644 --- a/tests/Feature/Notifications/NotificationTest.php +++ b/tests/Feature/Notifications/NotificationTest.php @@ -6,7 +6,9 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Http\Client\RequestException; +use Illuminate\Notifications\Events\NotificationSent; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Notification; use Mockery; @@ -62,7 +64,7 @@ public function test_notification() public function test_notification_failed() { - $this->expectException(RequestException::class); + Event::fake(); Http::fakeSequence() ->push($this->session) @@ -72,6 +74,10 @@ public function test_notification_failed() ->notify(new TestNotification(text: 'test')); Http::assertSentCount(2); + + Event::assertDispatched(function (NotificationSent $event) { + return $event->response->failed(); + }); } public function test_notification_fake() @@ -274,7 +280,7 @@ public function test_user_notify_oauth() { Http::fake(); - Bluesky::shouldReceive('withToken->refreshSession->post->throw')->once(); + Bluesky::shouldReceive('withToken->refreshSession->post')->once(); $user = new TestUserOAuth();