Spaces:
Sleeping
Sleeping
Download tests/Feature/Auth/VerificationNotificationTest.php from wepee/CAPS04-FE-REFACTOR: direct link, hf CLI and curl.
- Browser
- Download file 882 Bytes
-
https://huggingface.co/spaces/wepee/CAPS04-FE-REFACTOR/resolve/main/tests/Feature/Auth/VerificationNotificationTest.php
- Command line
-
hf download hf://spaces/wepee/CAPS04-FE-REFACTOR/tests/Feature/Auth/VerificationNotificationTest.php
-
curl -L -o VerificationNotificationTest.php https://huggingface.co/spaces/wepee/CAPS04-FE-REFACTOR/resolve/main/tests/Feature/Auth/VerificationNotificationTest.php
882 Bytes
| use App\Models\User; | |
| use Illuminate\Auth\Notifications\VerifyEmail; | |
| use Illuminate\Support\Facades\Notification; | |
| use Laravel\Fortify\Features; | |
| beforeEach(function () { | |
| $this->skipUnlessFortifyHas(Features::emailVerification()); | |
| }); | |
| test('sends verification notification', function () { | |
| Notification::fake(); | |
| $user = User::factory()->unverified()->create(); | |
| $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(); | |
| $this->actingAs($user) | |
| ->post(route('verification.send')) | |
| ->assertRedirect(route('dashboard', absolute: false)); | |
| Notification::assertNothingSent(); | |
| }); |