singleloginsystem/tests/Feature/Auth/RegistrationTest.php
2026-05-08 07:19:08 +00:00

30 lines
712 B
PHP

<?php
declare(strict_types=1);
use Laravel\Fortify\Features;
beforeEach(function (): void {
$this->skipUnlessFortifyHas(Features::registration());
});
test('registration screen can be rendered', function (): void {
$response = $this->get(route('register'));
$response->assertOk();
});
test('new users can register', function (): void {
$response = $this->post(route('register.store'), [
'name' => 'John Doe',
'email' => 'test@example.com',
'password' => 'password',
'password_confirmation' => 'password',
]);
$response->assertSessionHasNoErrors()
->assertRedirect(route('dashboard', absolute: false));
$this->assertAuthenticated();
});