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,43 @@
<?php
namespace Tests\Unit\Services\Assignment;
use App\Services\Assignment\AssignmentMetaService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class AssignmentMetaServiceTest extends TestCase
{
use RefreshDatabase;
public function test_get_school_years_uses_fallback(): void
{
$service = new AssignmentMetaService();
$years = $service->getSchoolYears('2025-2026');
$this->assertSame(['2025-2026'], $years);
}
public function test_get_school_years_returns_distinct_sorted(): void
{
DB::table('teacher_class')->insert([
['class_section_id' => 101, 'teacher_id' => 1, 'position' => 'main', 'school_year' => '2024-2025'],
['class_section_id' => 102, 'teacher_id' => 2, 'position' => 'main', 'school_year' => '2025-2026'],
['class_section_id' => 103, 'teacher_id' => 3, 'position' => 'main', 'school_year' => '2025-2026'],
]);
$service = new AssignmentMetaService();
$years = $service->getSchoolYears();
$this->assertSame(['2025-2026', '2024-2025'], $years);
}
public function test_first_non_empty_returns_first_value(): void
{
$service = new AssignmentMetaService();
$value = $service->firstNonEmpty([null, '', 'Fall', 'Spring']);
$this->assertSame('Fall', $value);
}
}