/
Shamaeva2
/
coursework.local
Обзор
Документация
Войти
/
Shamaeva2
/
coursework.local
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
tests/Feature/Auth/VerificationNotificationTest.php
40 строк
1 KB
Шамаева Виктория Сергеевна
Инициализация проекта
20 мар 2026, 14:08
20 мар 2026, 14:08
2ebca05
Код
Авторство
О чём код?
<?php namespace Tests\Feature\Auth; use App\Models\User; use Illuminate\Auth\Notifications\VerifyEmail; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Notification; use Tests\TestCase; class VerificationNotificationTest extends TestCase { use RefreshDatabase; public function test_sends_verification_notification(): void { Notification::fake(); $user = User::factory()->unverified()->create(); $this->actingAs($user) ->post(route('verification.send')) ->assertRedirect(route('home')); Notification::assertSentTo($user, VerifyEmail::class); } public function test_does_not_send_verification_notification_if_email_is_verified(): void { Notification::fake(); $user = User::factory()->create(); $this->actingAs($user) ->post(route('verification.send')) ->assertRedirect(route('dashboard', absolute: false)); Notification::assertNothingSent(); } }