fix all issues before deploy
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m18s

This commit is contained in:
root
2026-08-25 03:10:44 -04:00
parent 5f5afe97ad
commit 9899af7b37
11 changed files with 515 additions and 37 deletions
@@ -85,6 +85,51 @@ final class EnrollmentRegistrationEmailServiceTest extends TestCase
$this->assertSame('', $action);
}
public function testKgMissingDecisionEligibleMessageAllowsRegistration(): void
{
$service = $this->service();
$message = $this->invoke($service, 'decisionMessage', ['Student Name', [
'can_enroll' => false,
'kg_missing_decision_eligible' => true,
'deliberation_decision' => DeliberationDecision::PASSED,
'placement_status' => 'automatic_distribution_pending',
'assigned_grade_name' => '1',
'blocking_rule_codes' => ['NO_FINAL_DECISION'],
'blockers' => ['Re-enrollment cannot currently be completed because no final deliberation decision is recorded for the student. Registration will become available after the school records a final decision.'],
], 'August 1, 2026', 'August 31, 2026']);
$status = $this->invoke($service, 'registrationStatus', [[
'can_enroll' => false,
'kg_missing_decision_eligible' => true,
'deliberation_decision' => DeliberationDecision::PASSED,
'blocking_rule_codes' => ['NO_FINAL_DECISION'],
'blockers' => ['Re-enrollment cannot currently be completed because no final deliberation decision is recorded for the student. Registration will become available after the school records a final decision.'],
]]);
$this->assertSame('Eligible', $status);
$this->assertStringContainsString('KG students may complete registration now.', $message);
$this->assertStringContainsString('Student Name is eligible for re-enrollment even though no final deliberation decision is recorded.', $message);
$this->assertStringContainsString('Grade 1', $message);
$this->assertStringNotContainsString('cannot currently be completed', $message);
}
public function testAlreadyEnrolledStatusDoesNotRenderAsNotEligible(): void
{
$service = $this->service();
$status = $this->invoke($service, 'registrationStatus', [[
'can_enroll' => false,
'deliberation_decision' => DeliberationDecision::PASSED,
'decision' => 'ALREADY_ENROLLED',
'primary_block_reason' => 'ALREADY_ENROLLED',
'blocking_rule_codes' => ['ALREADY_ENROLLED'],
'blockers' => ['This student is already enrolled for the selected school year.'],
'enrollment_status' => 'enrolled',
]]);
$this->assertSame('Already Enrolled', $status);
}
public function testMakeupExamDecisionMessageUsesSchoolYearDateBeforeConfig(): void
{
$configModel = $this->createMock(ConfigurationModel::class);
@@ -231,6 +276,33 @@ final class EnrollmentRegistrationEmailServiceTest extends TestCase
$this->assertStringContainsString('parent/enroll_classes', $html);
}
public function testStudentIssueCodeUsesFlagRuleCode(): void
{
$service = $this->service();
$code = $this->invoke($service, 'studentIssueCode', [[
'flags' => [[
'flag_type' => 'DEFERRED_DELIBERATION',
'details' => ['rule_code' => 'NO_FINAL_DECISION'],
]],
]]);
$this->assertSame('NO_FINAL_DECISION', $code);
}
public function testStudentIssueCodeDoesNotColorNormalDecision(): void
{
$service = $this->service();
$code = $this->invoke($service, 'studentIssueCode', [[
'can_enroll' => true,
'deliberation_decision' => DeliberationDecision::PASSED,
'flags' => [],
]]);
$this->assertSame('', $code);
}
public function testParentReEnrollmentEligibilityUsesTransitionAllowedFlag(): void
{
$service = $this->service();