You are here

function FilterUnitTest::testHtmlEscapeFilter in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/filter/src/Tests/FilterUnitTest.php \Drupal\filter\Tests\FilterUnitTest::testHtmlEscapeFilter()

Tests the HTML escaping filter.

File

core/modules/filter/src/Tests/FilterUnitTest.php, line 534
Contains \Drupal\filter\Tests\FilterUnitTest.

Class

FilterUnitTest
Tests Filter module filters individually.

Namespace

Drupal\filter\Tests

Code

function testHtmlEscapeFilter() {

  // Get FilterHtmlEscape object.
  $filter = $this->filters['filter_html_escape'];
  $tests = array(
    "   One. <!-- \"comment\" --> Two'.\n<p>Three.</p>\n    " => array(
      "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);
}