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,22 @@
<?php
namespace Tests\Unit\Resources\Support;
use App\Http\Resources\Support\ContactMessageResource;
use Tests\TestCase;
class ContactMessageResourceTest extends TestCase
{
public function test_resource_returns_expected_shape(): void
{
$resource = new ContactMessageResource([
'email_sent' => true,
'recipient' => 'support@example.com',
]);
$payload = $resource->toArray(request());
$this->assertTrue($payload['email_sent']);
$this->assertSame('support@example.com', $payload['recipient']);
}
}
@@ -0,0 +1,28 @@
<?php
namespace Tests\Unit\Resources\Support;
use App\Http\Resources\Support\SupportRequestResource;
use App\Models\SupportRequest;
use Tests\TestCase;
class SupportRequestResourceTest extends TestCase
{
public function test_resource_returns_expected_shape(): void
{
$model = new SupportRequest([
'id' => 1,
'user_id' => 2,
'subject' => 'Help',
'message' => 'Need help',
'status' => 'open',
'semester' => 'Fall',
'school_year' => '2025-2026',
]);
$payload = (new SupportRequestResource($model))->toArray(request());
$this->assertSame(1, $payload['id']);
$this->assertSame('Help', $payload['subject']);
}
}