1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Create additional test helper classes

Following recent similar actions done for entities.
Required at this stage to provider better & cleaner helpers
for common user and permission actions to built out permission testing.
This commit is contained in:
Dan Brown
2022-12-15 12:29:10 +00:00
parent d54ea1b3ed
commit f844ae0902
66 changed files with 595 additions and 514 deletions

View File

@@ -275,7 +275,7 @@ class ExportTest extends TestCase
public function test_page_export_with_deleted_creator_and_updater()
{
$user = $this->getViewer(['name' => 'ExportWizardTheFifth']);
$user = $this->users->viewer(['name' => 'ExportWizardTheFifth']);
$page = $this->entities->page();
$page->created_by = $user->id;
$page->updated_by = $user->id;
@@ -409,7 +409,7 @@ class ExportTest extends TestCase
$chapter = $book->chapters()->first();
$page = $chapter->pages()->first();
$entities = [$book, $chapter, $page];
$user = $this->getViewer();
$user = $this->users->viewer();
$this->actingAs($user);
foreach ($entities as $entity) {
@@ -417,8 +417,7 @@ class ExportTest extends TestCase
$resp->assertSee('/export/pdf');
}
/** @var Role $role */
$this->removePermissionFromUser($user, 'content-export');
$this->permissions->removeUserRolePermissions($user, ['content-export']);
foreach ($entities as $entity) {
$resp = $this->get($entity->getUrl());