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:
@ -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'));
|
||||
|
Reference in New Issue
Block a user