1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Split command tests out to indavidual test files

This commit is contained in:
Dan Brown
2021-02-11 22:42:36 +00:00
parent ae353bb3f4
commit c09300c06f
9 changed files with 280 additions and 232 deletions

View File

@ -0,0 +1,21 @@
<?php namespace Tests\Commands;
use BookStack\Auth\Permissions\JointPermission;
use BookStack\Entities\Models\Page;
use Tests\TestCase;
class RegeneratePermissionsCommandTest extends TestCase
{
public function test_regen_permissions_command()
{
JointPermission::query()->truncate();
$page = Page::first();
$this->assertDatabaseMissing('joint_permissions', ['entity_id' => $page->id]);
$exitCode = \Artisan::call('bookstack:regenerate-permissions');
$this->assertTrue($exitCode === 0, 'Command executed successfully');
$this->assertDatabaseHas('joint_permissions', ['entity_id' => $page->id]);
}
}