mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Performed fixes for failing tests on php8
- Commands that run a truncate DB action failed due to messing up the test transations so we mnaully work around that now to ensure a transaction exists for the test to cleanup afterwards. - Updated dompdf lib version
This commit is contained in:
@ -2,12 +2,14 @@
|
||||
|
||||
use BookStack\Auth\Permissions\JointPermission;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Tests\TestCase;
|
||||
|
||||
class RegeneratePermissionsCommandTest extends TestCase
|
||||
{
|
||||
public function test_regen_permissions_command()
|
||||
{
|
||||
\DB::rollBack();
|
||||
JointPermission::query()->truncate();
|
||||
$page = Page::first();
|
||||
|
||||
@ -15,6 +17,7 @@ class RegeneratePermissionsCommandTest extends TestCase
|
||||
|
||||
$exitCode = \Artisan::call('bookstack:regenerate-permissions');
|
||||
$this->assertTrue($exitCode === 0, 'Command executed successfully');
|
||||
DB::beginTransaction();
|
||||
|
||||
$this->assertDatabaseHas('joint_permissions', ['entity_id' => $page->id]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user