-
-
-
';
+ $edit['filters[filter_html][settings][allowed_html]'] = " -
-
- \r\n
";
$this->drupalPostForm('admin/config/content/formats/manage/' . $restricted, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->drupalGet('admin/config/content/formats/manage/' . $restricted);
- $this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Allowed HTML tag added.');
+ $this->assertFieldByName('filters[filter_html][settings][allowed_html]', " -
-
-
", 'Allowed HTML tag added.');
$elements = $this->xpath('//select[@name=:first]/following::select[@name=:second]', array(
':first' => 'filters[' . $first_filter . '][weight]',
diff --git a/core/modules/filter/tests/src/Unit/FilterHtmlTest.php b/core/modules/filter/tests/src/Unit/FilterHtmlTest.php
index a3cde04e96d0e4874c1f01bfd6a9f8bac840c391..664c2a3001af991f8e45174e0e8c907b9ad56718 100644
--- a/core/modules/filter/tests/src/Unit/FilterHtmlTest.php
+++ b/core/modules/filter/tests/src/Unit/FilterHtmlTest.php
@@ -79,4 +79,18 @@ public function providerFilterAttributes() {
];
}
+ /**
+ * @covers ::setConfiguration
+ */
+ public function testSetConfiguration() {
+ $configuration['settings'] = [
+ // New lines and spaces are replaced with a single space.
+ 'allowed_html' => "
\r\n ",
+ 'filter_html_help' => 1,
+ 'filter_html_nofollow' => 0,
+ ];
+ $filter = new FilterHtml($configuration, 'filter_html', ['provider' => 'test']);
+ $this->assertSame('
', $filter->getConfiguration()['settings']['allowed_html']);
+ }
+
}