]> BookStack Code Mirror - bookstack/blobdiff - tests/Unit/PageIncludeParserTest.php
Tests: Updated comment test to account for new editor usage
[bookstack] / tests / Unit / PageIncludeParserTest.php
index fc071cf79c8a2ed33ec182da5c1f54a0f456f0c0..83fded4367d606b6c9d72d2f76a81b39b59ad5bb 100644 (file)
@@ -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();