Initialer Laravel Commit für BetiX
This commit is contained in:
41
tests/Feature/Auth/RegistrationTest.php
Normal file
41
tests/Feature/Auth/RegistrationTest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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));
|
||||
});
|
||||
Reference in New Issue
Block a user