Files
BetiX/tests/Feature/Auth/VerificationNotificationTest.php
Dolo 0280278978
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
Initialer Laravel Commit für BetiX
2026-04-04 18:01:50 +02:00

30 lines
735 B
PHP

<?php
use App\Notifications\VerifyEmail;
use App\Models\User;
use Illuminate\Support\Facades\Notification;
test('sends verification notification', function () {
$user = User::factory()->unverified()->create();
Notification::fake();
$this->actingAs($user)
->post(route('verification.send'))
->assertRedirect(route('dashboard'));
Notification::assertSentTo($user, VerifyEmail::class);
});
test('does not send verification notification if email is verified', function () {
Notification::fake();
$user = User::factory()->create();
$this->actingAs($user)
->post(route('verification.send'))
->assertRedirect(route('dashboard'));
Notification::assertNothingSent();
});