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,43 @@
<?php
namespace Tests\Unit\Services\Frontend;
use App\Services\Frontend\LandingPageTeacherSummaryService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class LandingPageTeacherSummaryServiceTest extends TestCase
{
use RefreshDatabase;
public function test_summary_returns_dashboard_payload(): void
{
DB::table('configuration')->insert([
['config_key' => 'school_year', 'config_value' => '2025-2026'],
['config_key' => 'semester', 'config_value' => 'Fall'],
]);
DB::table('teacher_class')->insert([
'teacher_id' => 1,
'class_section_id' => 101,
'position' => 'main',
'school_year' => '2025-2026',
]);
DB::table('classSection')->insert([
'class_id' => 1,
'class_section_id' => 101,
'class_section_name' => '1-A',
'semester' => 'Fall',
'school_year' => '2025-2026',
]);
$service = app(LandingPageTeacherSummaryService::class);
$payload = $service->summary(1);
$this->assertSame(101, $payload['class_section_id']);
$this->assertArrayHasKey('scoreSummary', $payload);
$this->assertArrayHasKey('attendanceSummary', $payload);
}
}