function FilterUnitTest::testHtmlEscapeFilter

Tests the HTML escaping filter.

check_plain() is not tested here.

File

drupal/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php, line 208
Definition of Drupal\filter\Tests\FilterUnitTest.

Class

FilterUnitTest
Unit tests for core filters.

Namespace

Drupal\filter\Tests

Code

function testHtmlEscapeFilter() {

  // Setup dummy filter object.
  $filter = new stdClass();
  $filter->callback = '_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);
}