mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
3ed878ab46
* fix: allow configurable domain and prefix for all supported routes * style: fix StyleCI finding
62 lines
1.3 KiB
PHP
62 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Feature\Actions\Fortify;
|
|
|
|
use App\Models\Auth\User;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* Class PasswordConfirmationTest.
|
|
*/
|
|
class PasswordConfirmationTest extends TestCase
|
|
{
|
|
/**
|
|
* Confirm password screen can be rendered.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testConfirmPasswordScreenCanBeRendered(): void
|
|
{
|
|
$user = User::factory()->createOne();
|
|
|
|
$response = $this->actingAs($user)->get(route('password.confirm'));
|
|
|
|
$response->assertStatus(200);
|
|
}
|
|
|
|
/**
|
|
* Password can be confirmed.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testPasswordCanBeConfirmed(): void
|
|
{
|
|
$user = User::factory()->createOne();
|
|
|
|
$response = $this->actingAs($user)->post(route('password.confirm'), [
|
|
'password' => 'password',
|
|
]);
|
|
|
|
$response->assertRedirect();
|
|
$response->assertSessionHasNoErrors();
|
|
}
|
|
|
|
/**
|
|
* Password is not confirmed with invalid password.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testPasswordIsNotConfirmedWithInvalidPassword(): void
|
|
{
|
|
$user = User::factory()->createOne();
|
|
|
|
$response = $this->actingAs($user)->post(route('password.confirm'), [
|
|
'password' => 'wrong-password',
|
|
]);
|
|
|
|
$response->assertSessionHasErrors();
|
|
}
|
|
}
|