Skip to content

NOW MANAGED ON CODEBERG

Added test to check text gen decodes HTML entities

Dan Brown2e39e458867b
diff --git a/tests/Entity/PageContentTest.php b/tests/Entity/PageContentTest.php
index d714c3229..7aeaf0012 100644
--- a/tests/Entity/PageContentTest.php
+++ b/tests/Entity/PageContentTest.php
@@ -304,4 +304,18 @@ class PageContentTest extends TestCase
'level' => 3,
], $navMap[2]);
}
+
+ public function test_page_text_decodes_html_entities()
+ {
+ $page = Page::query()->first();
+
+ $this->actingAs($this->getAdmin())
+ ->put($page->getUrl(''), [
+ 'name' => 'Testing',
+ 'html' => '<p>Hello &amp; welcome</p>',
+ ]);
+
+ $page->refresh();
+ $this->assertEquals('Hello & welcome', $page->text);
+ }
}