1
0
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:
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

@@ -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();