Files
alrahma_sunday_school/tests/app/Support/SchoolYear/SchoolYearTableRegistryTest.php
T
root e06ccc9cc0
Tests / PHPUnit (push) Failing after 40s
ADD SCHOOL YEAR MANAGEMENT
2026-07-12 02:21:39 -04:00

42 lines
1.4 KiB
PHP

<?php
namespace Tests\App\Support\SchoolYear;
use App\Support\SchoolYear\SchoolYearTableRegistry;
use CodeIgniter\Test\CIUnitTestCase;
use InvalidArgumentException;
final class SchoolYearTableRegistryTest extends CIUnitTestCase
{
public function testClassifiesYearScopedTables(): void
{
$this->assertSame('YEAR_SCOPED', SchoolYearTableRegistry::categoryOf('invoices'));
$this->assertSame('YEAR_SCOPED', SchoolYearTableRegistry::categoryOf('attendance_data'));
}
public function testClassifiesGlobalTables(): void
{
$this->assertSame('GLOBAL', SchoolYearTableRegistry::categoryOf('users'));
$this->assertSame('GLOBAL', SchoolYearTableRegistry::categoryOf('configuration'));
}
public function testClassifiesIdentityTables(): void
{
$this->assertSame('IDENTITY_WITH_YEAR_RELATION', SchoolYearTableRegistry::categoryOf('students'));
$this->assertSame('IDENTITY_WITH_YEAR_RELATION', SchoolYearTableRegistry::categoryOf('teachers'));
}
public function testClassifiesContextTables(): void
{
$this->assertSame('CONTEXT', SchoolYearTableRegistry::categoryOf('notifications'));
$this->assertSame('CONTEXT', SchoolYearTableRegistry::categoryOf('support_requests'));
}
public function testRejectsUnregisteredTables(): void
{
$this->expectException(InvalidArgumentException::class);
SchoolYearTableRegistry::categoryOf('unknown_table');
}
}