fadd column to enrollment table
This commit is contained in:
@@ -62,24 +62,10 @@ final class EnrollmentTransitionServiceTest extends TestCase
|
||||
]));
|
||||
}
|
||||
|
||||
public function testFirstEnrollmentPlacementUsesRegistrationGradeBaseSection(): void
|
||||
public function testFirstEnrollmentPlacementKeepsRegistrationGradeAsReferenceOnly(): void
|
||||
{
|
||||
$classBuilder = $this->builderReturning(['id' => 3, 'class_name' => '3']);
|
||||
$classBuilder->method('where')->willReturnSelf();
|
||||
|
||||
$sectionBuilder = $this->builderReturning([
|
||||
'class_section_id' => 30,
|
||||
'class_id' => 3,
|
||||
'class_section_name' => '3',
|
||||
]);
|
||||
$sectionBuilder->method('where')->willReturnSelf();
|
||||
|
||||
$db = $this->createMock(BaseConnection::class);
|
||||
$db->method('tableExists')->willReturnCallback(static fn (string $table): bool => $table === 'classSection');
|
||||
$db->method('fieldExists')->willReturn(false);
|
||||
$db->method('table')->willReturnCallback(static function (string $table) use ($classBuilder, $sectionBuilder) {
|
||||
return $table === 'classes' ? $classBuilder : $sectionBuilder;
|
||||
});
|
||||
$db->expects($this->never())->method('table');
|
||||
|
||||
$service = new EnrollmentTransitionService($db);
|
||||
|
||||
@@ -88,9 +74,10 @@ final class EnrollmentTransitionServiceTest extends TestCase
|
||||
'2026-2027',
|
||||
]);
|
||||
|
||||
$this->assertSame(3, (int) $placement['assigned_grade_id']);
|
||||
$this->assertSame(30, (int) $placement['assigned_class_section_id']);
|
||||
$this->assertSame('same_class_assigned', $placement['placement_status']);
|
||||
$this->assertNull($placement['assigned_grade_id']);
|
||||
$this->assertSame('3', $placement['assigned_grade_name']);
|
||||
$this->assertNull($placement['assigned_class_section_id']);
|
||||
$this->assertSame('manual_class_required', $placement['placement_status']);
|
||||
}
|
||||
|
||||
public function testClassLookupFallsBackToGlobalRowsWhenSchoolYearSpecificRowIsMissing(): void
|
||||
|
||||
Reference in New Issue
Block a user