Added an mechanism to upgrade permissions schema (manually by calling a program)

This commit is contained in:
Jan Böhmer 2023-01-08 00:15:35 +01:00
parent 60d5776cb7
commit 0e56f11b6b
5 changed files with 373 additions and 1 deletions

View file

@ -146,4 +146,16 @@ class PermissionDataTest extends TestCase
$this->assertFalse($data->isPermissionSet('perm1', 'op2'));
$this->assertFalse($data->isPermissionSet('perm1', 'op3'));
}
public function testGetSchemaVersion()
{
$data = new PermissionData();
//By default the schema version must be the CURRENT_SCHEMA_VERSION
$this->assertEquals(PermissionData::CURRENT_SCHEMA_VERSION, $data->getSchemaVersion());
//Ensure that the schema version can be set
$data->setSchemaVersion(12345);
$this->assertEquals(12345, $data->getSchemaVersion());
}
}