X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/b569827114693aec0f143a54dce5ddc693174734..refs/pull/5676/head:/tests/Unit/PageIncludeParserTest.php diff --git a/tests/Unit/PageIncludeParserTest.php b/tests/Unit/PageIncludeParserTest.php index fc071cf79..83fded436 100644 --- a/tests/Unit/PageIncludeParserTest.php +++ b/tests/Unit/PageIncludeParserTest.php @@ -2,7 +2,9 @@ namespace Tests\Unit; +use BookStack\Entities\Tools\PageIncludeContent; use BookStack\Entities\Tools\PageIncludeParser; +use BookStack\Entities\Tools\PageIncludeTag; use BookStack\Util\HtmlDocument; use Tests\TestCase; @@ -227,8 +229,9 @@ class PageIncludeParserTest extends TestCase protected function runParserTest(string $html, array $contentById, string $expected): void { $doc = new HtmlDocument($html); - $parser = new PageIncludeParser($doc, function (int $id) use ($contentById) { - return $contentById[strval($id)] ?? ''; + $parser = new PageIncludeParser($doc, function (PageIncludeTag $tag) use ($contentById): PageIncludeContent { + $html = $contentById[strval($tag->getPageId())] ?? ''; + return PageIncludeContent::fromHtmlAndTag($html, $tag); }); $parser->parse();