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:
21
tests/Commands/RegeneratePermissionsCommandTest.php
Normal file
21
tests/Commands/RegeneratePermissionsCommandTest.php
Normal 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]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user