reinstalled

This commit is contained in:
2025-05-06 23:15:56 +05:45
parent 96e5efeb1b
commit 9392d34c76
66 changed files with 2145 additions and 1096 deletions

View File

@ -1,44 +1,32 @@
<?php
namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class PasswordConfirmationTest extends TestCase
{
use RefreshDatabase;
test('confirm password screen can be rendered', function () {
$user = User::factory()->create();
public function test_confirm_password_screen_can_be_rendered(): void
{
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/confirm-password');
$response = $this->actingAs($user)->get('/confirm-password');
$response->assertStatus(200);
});
$response->assertStatus(200);
}
test('password can be confirmed', function () {
$user = User::factory()->create();
public function test_password_can_be_confirmed(): void
{
$user = User::factory()->create();
$response = $this->actingAs($user)->post('/confirm-password', [
'password' => 'password',
]);
$response = $this->actingAs($user)->post('/confirm-password', [
'password' => 'password',
]);
$response->assertRedirect();
$response->assertSessionHasNoErrors();
});
$response->assertRedirect();
$response->assertSessionHasNoErrors();
}
test('password is not confirmed with invalid password', function () {
$user = User::factory()->create();
public function test_password_is_not_confirmed_with_invalid_password(): void
{
$user = User::factory()->create();
$response = $this->actingAs($user)->post('/confirm-password', [
'password' => 'wrong-password',
]);
$response = $this->actingAs($user)->post('/confirm-password', [
'password' => 'wrong-password',
]);
$response->assertSessionHasErrors();
}
}
$response->assertSessionHasErrors();
});