Commit awal: prototipe UI SIAKAD Untan

This commit is contained in:
Ariyutta
2026-10-24 11:45:32 +07:00
commit d9b9cb5c0f
477 changed files with 51958 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace Tests;
use App\Enums\Role;
use App\Models\User;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
protected function setUp(): void
{
parent::setUp();
// Aset Vite tidak dibutuhkan; tes tidak boleh bergantung pada `npm run build`.
$this->withoutVite();
}
/**
* Buat akun untuk role tertentu beserta baris profilnya.
*
* @param array<string, mixed> $attributes kolom akun (name, username, is_active, ...)
* @param array<string, mixed> $profile kolom profil (nim, nip, ...)
*/
protected function userWithRole(Role $role, array $attributes = [], array $profile = []): User
{
$user = User::factory()->state(['role' => $role])->create($attributes);
$role->profileModel()::factory()->create(['user_id' => $user->id, ...$profile]);
return $user;
}
}