Files
alrahma_sunday_school_api/tests/Unit/Services/Attendance/TeacherAttendanceApiControllerTest.php
2026-03-09 16:03:16 -04:00

34 lines
849 B
PHP

<?php
namespace Tests\Feature\Api\Attendance;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
class TeacherAttendanceApiControllerTest extends TestCase
{
use RefreshDatabase;
public function test_teacher_grid_endpoint_returns_success(): void
{
$user = User::factory()->create();
Sanctum::actingAs($user);
$response = $this->getJson('/api/v1/attendance/teacher/grid');
$response->assertStatus(200);
}
public function test_teacher_form_endpoint_returns_success_or_validation_message(): void
{
$user = User::factory()->create();
Sanctum::actingAs($user);
$response = $this->getJson('/api/v1/attendance/teacher/form');
$this->assertContains($response->status(), [200, 422]);
}
}