Skip to content

Commit e84fe95

Browse files
committed
Fix test
1 parent 8a3c31c commit e84fe95

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/Feature/SendVerificationCodeTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ function ($notification, $channels, $notifiable) {
5151
/** @test */
5252
public function it_sends_notification_using_provided_channel()
5353
{
54-
$this->mock(NotificationFake::class, function ($mock) {
55-
$mock->shouldReceive('route')
56-
->with('a-random-channel', 'taylor@laravel.com')
57-
->andReturnSelf()
58-
->shouldReceive('notify');
59-
});
54+
if (! method_exists(NotificationFake::class, 'assertSentOnDemand')) {
55+
$this->markTestSkipped('assertSentOnDemand method not available on NotificationFake');
56+
}
6057

6158
VerificationCodeFacade::send('taylor@laravel.com', 'a-random-channel');
59+
60+
Notification::assertSentOnDemand(function (VerificationCodeCreated $notification, array $channels, object $notifiable) {
61+
return $notifiable->routes === ['a-random-channel' => 'taylor@laravel.com'];
62+
});
6263
}
6364

6465
/** @test */

0 commit comments

Comments
 (0)