1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +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

@ -11,8 +11,7 @@ class ChapterTest extends TestCase
{
public function test_create()
{
/** @var Book $book */
$book = Book::query()->first();
$book = $this->entities->book();
$chapter = Chapter::factory()->make([
'name' => 'My First Chapter',
@ -58,8 +57,7 @@ class ChapterTest extends TestCase
public function test_show_view_has_copy_button()
{
/** @var Chapter $chapter */
$chapter = Chapter::query()->first();
$chapter = $this->entities->chapter();
$resp = $this->asEditor()->get($chapter->getUrl());
$this->withHtml($resp)->assertElementContains("a[href$=\"{$chapter->getUrl('/copy')}\"]", 'Copy');
@ -67,8 +65,7 @@ class ChapterTest extends TestCase
public function test_copy_view()
{
/** @var Chapter $chapter */
$chapter = Chapter::query()->first();
$chapter = $this->entities->chapter();
$resp = $this->asEditor()->get($chapter->getUrl('/copy'));
$resp->assertOk();
@ -149,8 +146,7 @@ class ChapterTest extends TestCase
public function test_sort_book_action_visible_if_permissions_allow()
{
/** @var Chapter $chapter */
$chapter = Chapter::query()->first();
$chapter = $this->entities->chapter();
$resp = $this->actingAs($this->getViewer())->get($chapter->getUrl());
$this->withHtml($resp)->assertLinkNotExists($chapter->book->getUrl('sort'));