entities->page(); $editor = $this->users->editor(); $this->permissions->addEntityPermission($page, ['view'], null, $editor); CollapsedPermission::query()->truncate(); $this->assertDatabaseMissing('entity_permissions_collapsed', ['entity_id' => $page->id]); $exitCode = Artisan::call('bookstack:regenerate-permissions'); $this->assertTrue($exitCode === 0, 'Command executed successfully'); $this->assertDatabaseHas('entity_permissions_collapsed', [ 'entity_id' => $page->id, 'user_id' => $editor->id, 'view' => 1, ]); CollapsedPermission::query()->truncate(); DB::beginTransaction(); } }