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
@@ -11,7 +11,8 @@ class PaymentMissedCheckService
public function __construct(
private UserNotificationDispatchService $notifier,
private EmailService $emailService
) {}
) {
}
public function findUsersWithMissedPayments(): array
{
@@ -45,7 +46,7 @@ class PaymentMissedCheckService
foreach ($users as $user) {
$userId = (int) ($user['user_id'] ?? 0);
$email = (string) ($user['email'] ?? '');
$name = trim((string) ($user['firstname'] ?? '').' '.(string) ($user['lastname'] ?? ''));
$name = trim((string) ($user['firstname'] ?? '') . ' ' . (string) ($user['lastname'] ?? ''));
$this->notifier->notifyUser(
$userId,
@@ -58,8 +59,8 @@ class PaymentMissedCheckService
if ($email !== '') {
$subject = 'Payment Missed';
$body = '<p>Dear '.e($name !== '' ? $name : 'Parent').',</p>'
.'<p>You have a missed payment. Please pay to avoid penalty.</p>';
$body = '<p>Dear ' . e($name !== '' ? $name : 'Parent') . ',</p>'
. '<p>You have a missed payment. Please pay to avoid penalty.</p>';
$ok = $this->emailService->send($email, $subject, $body, 'finance');
$ok ? $sent++ : $failed++;
}