Files
alrahma_sunday_school/tests/app/Services/EnrollmentStatusServiceTest.php
T
root d906a915d6
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m20s
add refund logic and fix books inventory logic
2026-08-22 13:44:25 -04:00

46 lines
1.2 KiB
PHP

<?php
namespace Tests\App\Services;
use App\Services\EnrollmentStatusService;
use CodeIgniter\Database\BaseConnection;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
final class EnrollmentStatusServiceTest extends TestCase
{
/**
* @dataProvider statusMappingProvider
*/
public function testEnrollmentStatusMapsToStudentActivity(string $status, int $expected): void
{
$service = new EnrollmentStatusService($this->createMock(BaseConnection::class));
$this->assertSame($expected, $service->activeFlagForStatus($status));
}
public static function statusMappingProvider(): array
{
return [
['admission under review', 1],
['review & decision', 1],
['payment pending', 1],
['enrolled', 1],
['withdraw under review', 1],
['refund pending', 0],
['denied', 0],
['withdrawn', 0],
['waitlist', 0],
];
}
public function testUnknownStatusIsRejected(): void
{
$service = new EnrollmentStatusService($this->createMock(BaseConnection::class));
$this->expectException(InvalidArgumentException::class);
$service->activeFlagForStatus('accepted');
}
}