+ $this->get($pageUrl . '/delete')->assertOk()->assertSee('Delete Page');
+ }
+
+ protected function entityRestrictionFormTest(string $model, string $title, string $permission, string $roleId)
+ {
+ /** @var Entity $modelInstance */
+ $modelInstance = $model::query()->first();
+ $this->asAdmin()->get($modelInstance->getUrl('/permissions'))
+ ->assertSee($title);
+
+ $this->put($modelInstance->getUrl('/permissions'), [
+ 'restricted' => 'true',
+ 'restrictions' => [
+ $roleId => [
+ $permission => 'true'
+ ]
+ ],
+ ]);
+
+ $this->assertDatabaseHas($modelInstance->getTable(), ['id' => $modelInstance->id, 'restricted' => true]);
+ $this->assertDatabaseHas('entity_permissions', [
+ 'restrictable_id' => $modelInstance->id,
+ 'restrictable_type' => $modelInstance->getMorphClass(),
+ 'role_id' => $roleId,
+ 'action' => $permission,
+ ]);