initial commit
This commit is contained in:
commit
2e0cbc254c
174 changed files with 27742 additions and 0 deletions
33
tests/Feature/Auth/VerificationNotificationTest.php
Normal file
33
tests/Feature/Auth/VerificationNotificationTest.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Notifications\VerifyEmail;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
test('sends verification notification', function () {
|
||||
Notification::fake();
|
||||
|
||||
$user = User::factory()->create([
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('verification.send'))
|
||||
->assertRedirect(route('home'));
|
||||
|
||||
Notification::assertSentTo($user, VerifyEmail::class);
|
||||
});
|
||||
|
||||
test('does not send verification notification if email is verified', function () {
|
||||
Notification::fake();
|
||||
|
||||
$user = User::factory()->create([
|
||||
'email_verified_at' => now(),
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('verification.send'))
|
||||
->assertRedirect(route('dashboard', absolute: false));
|
||||
|
||||
Notification::assertNothingSent();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue