]> BookStack Code Mirror - bookstack/commitdiff
Added test to check text gen decodes HTML entities
authorDan Brown <redacted>
Sat, 19 Sep 2020 13:58:18 +0000 (14:58 +0100)
committerDan Brown <redacted>
Sat, 19 Sep 2020 13:58:18 +0000 (14:58 +0100)
tests/Entity/PageContentTest.php

index d714c3229db7a8dfeecd587c67b0d9f41cde4457..7aeaf0012a023eb4657f13f236bf4ff51b84e208 100644 (file)
@@ -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);
+    }
 }