mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +03:00
Migrated much test entity usage via find/replace
This commit is contained in:
@@ -58,8 +58,7 @@ class PageEditorTest extends TestCase
|
||||
public function test_empty_markdown_still_saves_without_error()
|
||||
{
|
||||
$this->setSettings(['app-editor' => 'markdown']);
|
||||
/** @var Book $book */
|
||||
$book = Book::query()->first();
|
||||
$book = $this->entities->book();
|
||||
|
||||
$this->asEditor()->get($book->getUrl('/create-page'));
|
||||
$draft = Page::query()->where('book_id', '=', $book->id)
|
||||
@@ -108,8 +107,7 @@ class PageEditorTest extends TestCase
|
||||
|
||||
public function test_switching_from_html_to_clean_markdown_works()
|
||||
{
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
$page = $this->entities->page();
|
||||
$page->html = '<h2>A Header</h2><p>Some <strong>bold</strong> content.</p>';
|
||||
$page->save();
|
||||
|
||||
@@ -121,8 +119,7 @@ class PageEditorTest extends TestCase
|
||||
|
||||
public function test_switching_from_html_to_stable_markdown_works()
|
||||
{
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
$page = $this->entities->page();
|
||||
$page->html = '<h2>A Header</h2><p>Some <strong>bold</strong> content.</p>';
|
||||
$page->save();
|
||||
|
||||
@@ -134,8 +131,7 @@ class PageEditorTest extends TestCase
|
||||
|
||||
public function test_switching_from_markdown_to_wysiwyg_works()
|
||||
{
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
$page = $this->entities->page();
|
||||
$page->html = '';
|
||||
$page->markdown = "## A Header\n\nSome content with **bold** text!";
|
||||
$page->save();
|
||||
@@ -180,8 +176,7 @@ class PageEditorTest extends TestCase
|
||||
|
||||
public function test_page_editor_type_switch_does_not_work_without_change_editor_permissions()
|
||||
{
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
$page = $this->entities->page();
|
||||
$page->html = '<h2>A Header</h2><p>Some <strong>bold</strong> content.</p>';
|
||||
$page->save();
|
||||
|
||||
@@ -193,8 +188,7 @@ class PageEditorTest extends TestCase
|
||||
|
||||
public function test_page_save_does_not_change_active_editor_without_change_editor_permissions()
|
||||
{
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
$page = $this->entities->page();
|
||||
$page->html = '<h2>A Header</h2><p>Some <strong>bold</strong> content.</p>';
|
||||
$page->editor = 'wysiwyg';
|
||||
$page->save();
|
||||
|
||||
Reference in New Issue
Block a user