mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Extracted entity testcase methods to own class
Also added some new fetch helper methods for future use.
This commit is contained in:
@ -22,7 +22,7 @@ class CopyShelfPermissionsCommandTest extends TestCase
|
||||
$this->assertFalse(boolval($child->restricted), 'Child book should not be restricted by default');
|
||||
$this->assertTrue($child->permissions()->count() === 0, 'Child book should have no permissions by default');
|
||||
|
||||
$this->setEntityRestrictions($shelf, ['view', 'update'], [$editorRole]);
|
||||
$this->entities->setPermissions($shelf, ['view', 'update'], [$editorRole]);
|
||||
$this->artisan('bookstack:copy-shelf-permissions', [
|
||||
'--slug' => $shelf->slug,
|
||||
]);
|
||||
@ -43,7 +43,7 @@ class CopyShelfPermissionsCommandTest extends TestCase
|
||||
$this->assertFalse(boolval($child->restricted), 'Child book should not be restricted by default');
|
||||
$this->assertTrue($child->permissions()->count() === 0, 'Child book should have no permissions by default');
|
||||
|
||||
$this->setEntityRestrictions($shelf, ['view', 'update'], [$editorRole]);
|
||||
$this->entities->setPermissions($shelf, ['view', 'update'], [$editorRole]);
|
||||
$this->artisan('bookstack:copy-shelf-permissions --all')
|
||||
->expectsQuestion('Permission settings for all shelves will be cascaded. Books assigned to multiple shelves will receive only the permissions of it\'s last processed shelf. Are you sure you want to proceed?', 'y');
|
||||
$child = $shelf->books()->first();
|
||||
|
Reference in New Issue
Block a user