fix deployment db issue and widthrawal administration page
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-08-20 20:18:00 -04:00
parent 889c037660
commit d3da699e55
19 changed files with 1170 additions and 194 deletions
@@ -29,7 +29,8 @@ class SessionTimeoutControllerTest extends CIUnitTestCase
$this->assertTrue($body['success']);
$this->assertSame(1800, $body['timeout']);
$this->assertSame(30, $body['warning_time']);
$this->assertSame(5000, $body['check_interval']);
$this->assertSame(30000, $body['check_interval']);
$this->assertSame(60000, $body['ping_interval']);
$this->assertStringContainsString('session/check-timeout', $body['check_url']);
$this->assertStringContainsString('session/ping-activity', $body['keep_alive_url']);
}
@@ -112,6 +112,15 @@ final class SchoolYearWritableFilterTest extends CIUnitTestCase
$this->assertNull((new SchoolYearWritableFilter())->before($request));
}
public function testSessionPingActivityPostIsExempt(): void
{
$this->useSchoolYearContext(['id' => 1, 'name' => '2025-2026', 'status' => 'closed']);
$request = $this->request('POST', 'https://example.test/session/ping-activity');
$this->assertNull((new SchoolYearWritableFilter())->before($request));
}
public function testReadRequestsAreAllowedForClosedSelectedYear(): void
{
$this->useSchoolYearContext(['id' => 1, 'name' => '2025-2026', 'status' => 'closed']);
@@ -187,6 +187,35 @@ final class EnrollmentTransitionServiceTest extends TestCase
]]));
}
public function testTargetEnrollmentReviewCodesIncludeWithdrawnRows(): void
{
$builder = $this->createMock(BaseBuilder::class);
$builder->method('select')->willReturnSelf();
$builder->method('where')->willReturnSelf();
$builder->method('orderBy')->willReturnSelf();
$builder->method('get')->willReturn(new class {
public function getResultArray(): array
{
return [[
'student_id' => 42,
'enrollment_status' => 'payment pending',
'admission_status' => 'accepted',
'is_withdrawn' => 1,
]];
}
});
$db = $this->createMock(BaseConnection::class);
$db->method('tableExists')->with('enrollments')->willReturn(true);
$db->method('fieldExists')->with('is_withdrawn', 'enrollments')->willReturn(true);
$db->method('table')->with('enrollments')->willReturn($builder);
$service = new EnrollmentTransitionService($db);
$reviewCodes = $this->invoke($service, 'targetEnrollmentReviewCodesByStudent', ['2026-2027']);
$this->assertSame('WITHDRAWN', $reviewCodes[42]['rule_code']);
}
/**
* @param list<array<string, mixed>> $rows
*/