feat: update to Laravel 12 starter kit (#1)

fix: path of ScreenGeneratorCommand
This commit is contained in:
Benjamin Nussbaum 2025-02-25 12:15:35 +01:00 committed by GitHub
parent 199511816e
commit 94f5cabcff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
110 changed files with 3260 additions and 3524 deletions

View file

@ -1,18 +1,16 @@
<?php
namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Support\Facades\Notification;
use Livewire\Volt\Volt;
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
test('reset password link screen can be rendered', function () {
$response = $this->get('/forgot-password');
$response
->assertSeeVolt('pages.auth.forgot-password')
->assertStatus(200);
$response->assertStatus(200);
});
test('reset password link can be requested', function () {
@ -20,7 +18,7 @@ test('reset password link can be requested', function () {
$user = User::factory()->create();
Volt::test('pages.auth.forgot-password')
Volt::test('auth.forgot-password')
->set('email', $user->email)
->call('sendPasswordResetLink');
@ -32,16 +30,14 @@ test('reset password screen can be rendered', function () {
$user = User::factory()->create();
Volt::test('pages.auth.forgot-password')
Volt::test('auth.forgot-password')
->set('email', $user->email)
->call('sendPasswordResetLink');
Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
$response = $this->get('/reset-password/'.$notification->token);
$response
->assertSeeVolt('pages.auth.reset-password')
->assertStatus(200);
$response->assertStatus(200);
return true;
});
@ -52,22 +48,21 @@ test('password can be reset with valid token', function () {
$user = User::factory()->create();
Volt::test('pages.auth.forgot-password')
Volt::test('auth.forgot-password')
->set('email', $user->email)
->call('sendPasswordResetLink');
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) {
$component = Volt::test('pages.auth.reset-password', ['token' => $notification->token])
$response = Volt::test('auth.reset-password', ['token' => $notification->token])
->set('email', $user->email)
->set('password', 'password')
->set('password_confirmation', 'password');
->set('password_confirmation', 'password')
->call('resetPassword');
$component->call('resetPassword');
$component
->assertRedirect('/login')
->assertHasNoErrors();
$response
->assertHasNoErrors()
->assertRedirect(route('login', absolute: false));
return true;
});
});
});