add controllers, servoices

This commit is contained in:
root
2026-03-09 02:52:13 -04:00
parent c8de5f7edc
commit d76c871cb7
501 changed files with 34439 additions and 21843 deletions
@@ -0,0 +1,27 @@
<?php
namespace Tests\Unit\Services\Semesters;
use App\Services\Semesters\SemesterConfigService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class SemesterConfigServiceTest extends TestCase
{
use RefreshDatabase;
public function test_reads_dates_from_configuration(): void
{
DB::table('configuration')->insert([
['id' => 1, 'config_key' => 'fall_semester_start', 'config_value' => '2025-09-01'],
['id' => 2, 'config_key' => 'spring_semester_start', 'config_value' => '2026-01-20'],
['id' => 3, 'config_key' => 'last_school_day', 'config_value' => '2026-06-01'],
]);
$service = new SemesterConfigService();
$this->assertSame('2025-09-01', $service->getFallStart()?->format('Y-m-d'));
$this->assertSame('2026-01-20', $service->getSpringStart()?->format('Y-m-d'));
$this->assertSame('2026-06-01', $service->getLastSchoolDay()?->format('Y-m-d'));
}
}