function FilterKernelTest::testHtmlEscapeFilter

Tests the HTML escaping filter.

File

core/modules/filter/tests/src/Kernel/FilterKernelTest.php, line 533

Class

FilterKernelTest
Tests Filter module filters individually.

Namespace

Drupal\Tests\filter\Kernel

Code

public function testHtmlEscapeFilter() {
  // Get FilterHtmlEscape object.
  $filter = $this->filters['filter_html_escape'];
  $tests = [
    "   One. <!-- \"comment\" --> Two'.\n<p>Three.</p>\n    " => [
      "One. &lt;!-- &quot;comment&quot; --&gt; Two&#039;.\n&lt;p&gt;Three.&lt;/p&gt;" => TRUE,
      '   One.' => FALSE,
      "</p>\n    " => FALSE,
    ],
  ];
  $this->assertFilteredString($filter, $tests);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.