Files

33 lines
678 B
PHP

<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\User;
use Tests\TestCase;
class ExampleTest extends TestCase
{
use RefreshDatabase;
/**
* A basic test example.
*/
public function test_the_application_redirects_unauthenticated_users(): void
{
$response = $this->get('/');
$response->assertStatus(302);
$response->assertRedirect('/login');
}
public function test_authenticated_users_can_access_the_dashboard(): void
{
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/');
$response->assertStatus(200);
}
}