Files
go-no-go/tests/TestCase.php
2026-02-03 20:18:08 +01:00

26 lines
524 B
PHP

<?php
declare(strict_types=1);
namespace Tests;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use RefreshDatabase;
/**
* Create and authenticate a user for testing.
*/
protected function createAuthenticatedUser(array $attributes = []): User
{
$user = User::factory()->create($attributes);
$this->actingAs($user);
return $user;
}
}