Files
Epicnabbo-Catalogus-Updated…/Updated_Cms/tests/Feature/RegistrationTest.php
T
2026-01-07 19:32:43 +01:00

18 lines
565 B
PHP

<?php
use App\Providers\RouteServiceProvider;
test('new users can register', function (): void {
$response = $this->post('/register', [
'username' => 'Test_User',
'mail' => 'test@example.com',
'password' => 'password',
'password_confirmation' => 'password',
'terms' => true,
]);
expect(auth()->check())->toBeTrue()
->and($response->status())->toBe(302)
->and(parse_url((string) $response->headers->get('Location'), PHP_URL_PATH))->toBe(parse_url(RouteServiceProvider::HOME, PHP_URL_PATH));
});