lk-students/tests/Feature/Auth/RegistrationTest.php

32 lines
742 B
PHP
Raw Permalink Normal View History

2024-06-19 13:42:36 +03:00
<?php
namespace Tests\Feature\Auth;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class RegistrationTest extends TestCase
{
use RefreshDatabase;
2024-06-19 16:40:34 +03:00
public function testRegistrationScreenCanBeRendered(): void
2024-06-19 13:42:36 +03:00
{
$response = $this->get('/register');
$response->assertStatus(200);
}
2024-06-19 16:40:34 +03:00
public function testNewUsersCanRegister(): void
2024-06-19 13:42:36 +03:00
{
$response = $this->post('/register', [
'name' => 'Test User',
'email' => 'test@example.com',
'password' => 'password',
'password_confirmation' => 'password',
]);
$this->assertAuthenticated();
$response->assertRedirect(route('dashboard', absolute: false));
}
}