19 lines
509 B
PHP
19 lines
509 B
PHP
<?php
|
|
|
|
namespace Tests\App\Config;
|
|
|
|
use CodeIgniter\Test\CIUnitTestCase;
|
|
|
|
final class SchoolYearRouteIntegrityTest extends CIUnitTestCase
|
|
{
|
|
public function testSchoolYearManagementRoutesAllowPrincipalRole(): void
|
|
{
|
|
$routes = file_get_contents(ROOTPATH . 'app/Config/Routes.php') ?: '';
|
|
|
|
$this->assertMatchesRegularExpression(
|
|
"/\\\$routes->group\\('administrator\\/school-years', \\['filter' => 'auth:[^']*\\bprincipal\\b[^']*'\\]/",
|
|
$routes
|
|
);
|
|
}
|
|
}
|