Files
BetiX/tests/Feature/Auth/RegistrationTest.php
Dolo 0280278978
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
Initialer Laravel Commit für BetiX
2026-04-04 18:01:50 +02:00

42 lines
1.2 KiB
PHP

<?php
test('registration screen can be rendered', function () {
$response = $this->get(route('register'));
$response->assertOk();
});
test('new users can register', function () {
$response = $this->post('/register', [
'username' => 'Dolo',
'first_name' => 'Kevin',
'last_name' => 'Geiger',
'email' => 'laynox9@gmail.com',
'birthdate' => '2004-01-23',
'gender' => 'male',
'phone' => '+4915112350255',
'country' => 'DE',
'address_line1' => 'Siedlerstr. 15',
'address_line2' => '',
'city' => 'Türkheim',
'postal_code' => '86842',
'currency' => 'EUR',
'password' => 'Geheim123!',
'password_confirmation' => 'Geheim123!',
'is_adult' => true,
'terms_accepted' => true
]);
if ($response->status() !== 302) {
// Log errors to see what's failing if it's not a redirect
$errors = session('errors');
if ($errors) {
fwrite(STDERR, print_r($errors->getMessages(), true));
}
}
$response->assertStatus(302);
$this->assertAuthenticated('web');
$response->assertRedirect(route('dashboard', absolute: false));
});