Files
alrahma_sunday_school_api/tests/Unit/Services/Attendance/LateSlipLogCommandServiceTest.php
T
2026-03-11 17:53:15 -04:00

34 lines
928 B
PHP

<?php
namespace Tests\Unit\Services\Attendance;
use App\Models\LateSlipLog;
use App\Services\Attendance\LateSlipLogCommandService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class LateSlipLogCommandServiceTest extends TestCase
{
use RefreshDatabase;
public function test_delete_removes_log(): void
{
$log = LateSlipLog::query()->create([
'school_year' => '2025-2026',
'semester' => 'Fall',
'student_name' => 'Student X',
'slip_date' => '2025-09-01',
'time_in' => '08:05:00',
'grade' => '4',
'reason' => 'Traffic',
'admin_name' => 'Admin User',
]);
$service = app(LateSlipLogCommandService::class);
$deleted = $service->delete($log);
$this->assertTrue($deleted);
$this->assertDatabaseMissing('late_slip_logs', ['id' => $log->id]);
}
}