1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +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

@@ -2,20 +2,18 @@
namespace Tests\Entity;
use BookStack\Entities\Models\Book;
use BookStack\Entities\Models\Chapter;
use BookStack\Entities\Models\Page;
use Tests\TestCase;
class PageEditorTest extends TestCase
{
/** @var Page */
protected $page;
protected Page $page;
protected function setUp(): void
{
parent::setUp();
$this->page = Page::query()->first();
$this->page = $this->entities->page();
}
public function test_default_editor_is_wysiwyg_for_new_pages()
@@ -80,8 +78,7 @@ class PageEditorTest extends TestCase
public function test_back_link_in_editor_has_correct_url()
{
/** @var Book $book */
$book = Book::query()->whereHas('pages')->whereHas('chapters')->firstOrFail();
$book = $this->entities->bookHasChaptersAndPages();
$this->asEditor()->get($book->getUrl('/create-page'));
/** @var Chapter $chapter */
$chapter = $book->chapters()->firstOrFail();