1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Migrated much test entity usage via find/replace

This commit is contained in:
Dan Brown
2022-09-29 17:31:38 +01:00
parent 068a8a068c
commit b56f7355aa
45 changed files with 264 additions and 384 deletions

View File

@ -33,7 +33,7 @@ class SortTest extends TestCase
public function test_page_move_into_book()
{
$page = Page::query()->first();
$page = $this->entities->page();
$currentBook = $page->book;
$newBook = Book::query()->where('id', '!=', $currentBook->id)->first();
@ -55,7 +55,7 @@ class SortTest extends TestCase
public function test_page_move_into_chapter()
{
$page = Page::query()->first();
$page = $this->entities->page();
$currentBook = $page->book;
$newBook = Book::query()->where('id', '!=', $currentBook->id)->first();
$newChapter = $newBook->chapters()->first();
@ -93,7 +93,7 @@ class SortTest extends TestCase
public function test_page_move_requires_create_permissions_on_parent()
{
$page = Page::query()->first();
$page = $this->entities->page();
$currentBook = $page->book;
$newBook = Book::query()->where('id', '!=', $currentBook->id)->first();
$editor = $this->getEditor();
@ -118,7 +118,7 @@ class SortTest extends TestCase
public function test_page_move_requires_delete_permissions()
{
$page = Page::query()->first();
$page = $this->entities->page();
$currentBook = $page->book;
$newBook = Book::query()->where('id', '!=', $currentBook->id)->first();
$editor = $this->getEditor();
@ -145,7 +145,7 @@ class SortTest extends TestCase
public function test_chapter_move()
{
$chapter = Chapter::query()->first();
$chapter = $this->entities->chapter();
$currentBook = $chapter->book;
$pageToCheck = $chapter->pages->first();
$newBook = Book::query()->where('id', '!=', $currentBook->id)->first();
@ -173,7 +173,7 @@ class SortTest extends TestCase
public function test_chapter_move_requires_delete_permissions()
{
$chapter = Chapter::query()->first();
$chapter = $this->entities->chapter();
$currentBook = $chapter->book;
$newBook = Book::query()->where('id', '!=', $currentBook->id)->first();
$editor = $this->getEditor();
@ -200,7 +200,7 @@ class SortTest extends TestCase
public function test_chapter_move_requires_create_permissions_in_new_book()
{
$chapter = Chapter::query()->first();
$chapter = $this->entities->chapter();
$currentBook = $chapter->book;
$newBook = Book::query()->where('id', '!=', $currentBook->id)->first();
$editor = $this->getEditor();