mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Updated test for perms. changes and fixed static issues
This commit is contained in:
@@ -376,19 +376,18 @@ class EntityPermissionsTest extends TestCase
|
||||
->assertSee($title);
|
||||
|
||||
$this->put($modelInstance->getUrl('/permissions'), [
|
||||
'restrictions' => [
|
||||
'permissions' => [
|
||||
$roleId => [
|
||||
$permission => 'true',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas($modelInstance->getTable(), ['id' => $modelInstance->id, 'restricted' => true]);
|
||||
$this->assertDatabaseHas('entity_permissions', [
|
||||
'restrictable_id' => $modelInstance->id,
|
||||
'restrictable_type' => $modelInstance->getMorphClass(),
|
||||
'entity_id' => $modelInstance->id,
|
||||
'entity_type' => $modelInstance->getMorphClass(),
|
||||
'role_id' => $roleId,
|
||||
'action' => $permission,
|
||||
$permission => true,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -173,16 +173,16 @@ class RolesTest extends TestCase
|
||||
|
||||
$this->assertDatabaseHas('entity_permissions', [
|
||||
'role_id' => $roleA->id,
|
||||
'restrictable_id' => $page->id,
|
||||
'restrictable_type' => $page->getMorphClass(),
|
||||
'entity_id' => $page->id,
|
||||
'entity_type' => $page->getMorphClass(),
|
||||
]);
|
||||
|
||||
$this->asAdmin()->delete("/settings/roles/delete/$roleA->id");
|
||||
|
||||
$this->assertDatabaseMissing('entity_permissions', [
|
||||
'role_id' => $roleA->id,
|
||||
'restrictable_id' => $page->id,
|
||||
'restrictable_type' => $page->getMorphClass(),
|
||||
'entity_id' => $page->id,
|
||||
'entity_type' => $page->getMorphClass(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user