add all controllers logic

This commit is contained in:
root
2026-03-11 17:53:15 -04:00
parent 3e6c577085
commit 2ef71cc92b
421 changed files with 12009 additions and 5211 deletions
@@ -0,0 +1,29 @@
<?php
namespace Tests\Unit\Resources\Staff;
use App\Http\Resources\Staff\StaffResource;
use App\Models\Staff;
use Tests\TestCase;
class StaffResourceTest extends TestCase
{
public function test_resource_returns_expected_shape(): void
{
$staff = new Staff([
'id' => 1,
'user_id' => 2,
'firstname' => 'Test',
'lastname' => 'User',
'email' => 'test@example.com',
'role_name' => 'teacher',
'active_role' => 'teacher',
'school_year' => '2025-2026',
]);
$payload = (new StaffResource($staff))->toArray(request());
$this->assertSame(1, $payload['id']);
$this->assertSame('teacher', $payload['role_name']);
}
}