fix parent pages and teachers and admin
API CI/CD / Validate (composer + pint) (push) Successful in 3m8s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Test (PHPUnit) (push) Failing after 6m5s
API CI/CD / Security audit (push) Failing after 52s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped

This commit is contained in:
root
2026-07-09 13:56:22 -04:00
parent 21c9322127
commit 02ba2fe6b6
34 changed files with 2306 additions and 99 deletions
@@ -9,7 +9,9 @@ use App\Models\TeacherSubmissionNotificationHistory;
use App\Models\User;
use App\Services\Administrator\AdministratorSharedService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -290,6 +292,57 @@ class AdministratorTeacherSubmissionReportApiTest extends TestCase
$this->assertSame('Main: Legacy Teacher', $response->json('rows.0.teachers.0.label'));
}
public function test_teacher_submission_report_handles_student_class_without_semester_column(): void
{
Schema::table('student_class', function (Blueprint $table) {
$table->dropColumn('semester');
});
$admin = $this->seedAdminUser('admin.report.student-class-legacy@test.com');
Sanctum::actingAs($admin, [], 'api');
User::factory()->create([
'id' => 220,
'firstname' => 'StudentClass',
'lastname' => 'Legacy',
'email' => 'student.class.legacy.teacher@test.com',
]);
DB::table('classSection')->insert([
[
'class_section_id' => 22,
'class_section_name' => 'Grade 9A',
'class_id' => 9,
'semester' => 'Fall',
'school_year' => '2025-2026',
],
]);
DB::table('teacher_class')->insert([
[
'class_section_id' => 22,
'teacher_id' => 220,
'position' => 'main',
'school_year' => '2025-2026',
'semester' => 'Fall',
],
]);
DB::table('student_class')->insert([
'student_id' => 1,
'class_section_id' => 22,
'school_year' => '2025-2026',
]);
$response = $this->getJson('/api/v1/administrator/teacher-submissions?school_year=2025-2026');
$response->assertOk()
->assertJsonCount(1, 'rows');
$this->assertSame('Grade 9A', $response->json('rows.0.class_section'));
$this->assertSame(1, $response->json('rows.0.student_count'));
}
public function test_teacher_submission_report_limits_history_to_three_entries(): void
{
$admin = $this->seedAdminUser('admin.report.two@test.com', 901, 'Admin', 'Two');