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

@@ -64,7 +64,7 @@ class ThemeTest extends TestCase
};
Theme::listen(ThemeEvents::COMMONMARK_ENVIRONMENT_CONFIGURE, $callback);
$page = Page::query()->first();
$page = $this->entities->page();
$content = new PageContent($page);
$content->setNewMarkdown('# test');
@@ -199,7 +199,7 @@ class ThemeTest extends TestCase
public function test_event_activity_logged()
{
$book = Book::query()->first();
$book = $this->entities->book();
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
@@ -218,7 +218,7 @@ class ThemeTest extends TestCase
{
/** @var Page $page */
/** @var Page $otherPage */
$page = Page::query()->first();
$page = $this->entities->page();
$otherPage = Page::query()->where('id', '!=', $page->id)->first();
$otherPage->html = '<p id="bkmrk-cool">This is a really cool section</p>';
$page->html = "<p>{{@{$otherPage->id}#bkmrk-cool}}</p>";
@@ -324,8 +324,7 @@ class ThemeTest extends TestCase
{
$bodyStartStr = 'garry-fought-against-the-panther';
$bodyEndStr = 'garry-lost-his-fight-with-grace';
/** @var Page $page */
$page = Page::query()->first();
$page = $this->entities->page();
$this->usingThemeFolder(function (string $folder) use ($bodyStartStr, $bodyEndStr, $page) {
$viewDir = theme_path('layouts/parts');