add tests batch 20

This commit is contained in:
root
2026-06-09 01:03:53 -04:00
parent 95efb9652e
commit 6be4875c5e
1502 changed files with 13797 additions and 11313 deletions
@@ -12,7 +12,8 @@ class BadgeStudentLookupService
{
public function __construct(
protected BadgeTextFormatter $formatter
) {}
) {
}
/**
* Active student roster for the badge picker.
@@ -28,7 +29,7 @@ class BadgeStudentLookupService
->leftJoin('student_class as sc', function ($join) use ($schoolYear) {
$join->on('sc.student_id', '=', 'students.id');
if (! empty($schoolYear)) {
if (!empty($schoolYear)) {
$join->where('sc.school_year', '=', $schoolYear);
}
})
@@ -54,9 +55,9 @@ class BadgeStudentLookupService
->orderBy('students.lastname')
->orderBy('students.firstname');
if (! empty($selectedStudentIds)) {
if (!empty($selectedStudentIds)) {
$query->whereIn('students.id', $selectedStudentIds);
} elseif (! empty($schoolYear)) {
} elseif (!empty($schoolYear)) {
$query->where(function ($q) use ($schoolYear) {
$q->where('students.school_year', $schoolYear)
->orWhereNotNull('sc.student_id');
@@ -73,7 +74,7 @@ class BadgeStudentLookupService
}
$schoolId = trim((string) ($row['school_id'] ?? ''));
if ($schoolId === '' || ! preg_match('/^[A-Za-z0-9_-]+$/', $schoolId)) {
if ($schoolId === '' || !preg_match('/^[A-Za-z0-9_-]+$/', $schoolId)) {
continue;
}
@@ -116,7 +117,7 @@ class BadgeStudentLookupService
$out = [];
foreach ($rows as $student) {
$schoolId = trim((string) ($student->school_id ?? ''));
if ($schoolId === '' || ! preg_match('/^[A-Za-z0-9_-]+$/', $schoolId)) {
if ($schoolId === '' || !preg_match('/^[A-Za-z0-9_-]+$/', $schoolId)) {
continue;
}