1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Quick run through of applying new test entity helper class

This commit is contained in:
Dan Brown
2022-09-29 22:11:16 +01:00
parent b56f7355aa
commit 900e853b15
47 changed files with 198 additions and 286 deletions

View File

@ -96,8 +96,7 @@ class ChapterTest extends TestCase
public function test_copy_does_not_copy_non_visible_pages()
{
/** @var Chapter $chapter */
$chapter = Chapter::query()->whereHas('pages')->first();
$chapter = $this->entities->chapterHasPages();
// Hide pages to all non-admin roles
/** @var Page $page */
@ -118,8 +117,7 @@ class ChapterTest extends TestCase
public function test_copy_does_not_copy_pages_if_user_cant_page_create()
{
/** @var Chapter $chapter */
$chapter = Chapter::query()->whereHas('pages')->first();
$chapter = $this->entities->chapterHasPages();
$viewer = $this->getViewer();
$this->giveUserPermissions($viewer, ['chapter-create-all']);