Skip to content

Commit

Permalink
Update NotificationTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
kawax committed Nov 17, 2024
1 parent 01e1d85 commit aa527d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Feature/Notifications/NotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -62,7 +64,7 @@ public function test_notification()

public function test_notification_failed()
{
$this->expectException(RequestException::class);
Event::fake();

Http::fakeSequence()
->push($this->session)
Expand All @@ -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()
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit aa527d7

Please sign in to comment.