fix deployment db issue and widthrawal administration page
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user