Install Pest

This commit is contained in:
Bob Molitor
2025-10-16 14:22:58 +02:00
parent 81a98dd9f4
commit e8db0d9a5a
16 changed files with 1618 additions and 805 deletions
+10 -21
View File
@@ -1,27 +1,16 @@
<?php
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class DashboardTest extends TestCase
{
use RefreshDatabase;
test('guests are redirected to the login page', function () {
$response = $this->get(route('dashboard'));
$response->assertRedirect(route('login'));
});
public function test_guests_are_redirected_to_the_login_page(): void
{
$response = $this->get(route('dashboard'));
$response->assertRedirect(route('login'));
}
test('authenticated users can visit the dashboard', function () {
$user = User::factory()->create();
$this->actingAs($user);
public function test_authenticated_users_can_visit_the_dashboard(): void
{
$user = User::factory()->create();
$this->actingAs($user);
$response = $this->get(route('dashboard'));
$response->assertStatus(200);
}
}
$response = $this->get(route('dashboard'));
$response->assertStatus(200);
});