25 lines
572 B
PHP
25 lines
572 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
use App\Models\User;
|
|
|
|
class UserManagementTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_user_can_be_created()
|
|
{
|
|
$response = $this->post('/register', [
|
|
'name' => 'Test User',
|
|
'email' => 'test@example.com',
|
|
'password' => 'password',
|
|
'password_confirmation' => 'password',
|
|
]);
|
|
|
|
$response->assertRedirect('/home');
|
|
$this->assertCount(1, User::all());
|
|
}
|
|
}
|