7.x filter.test FilterUnitTestCase::assertNoNormalized($haystack, $needle, $message = '', $group = 'Other')

Asserts that text transformed to lowercase with HTML entities decoded does not contain a given string.

Otherwise fails the test with a given message, similar to all the SimpleTest assert* functions.

Note that this does not remove nulls, new lines, and other character that could be used to obscure a tag or an attribute name.


$haystack: Text to look in.

$needle: Lowercase, plain text to look for.

$message: (optional) Message to display if failed. Defaults to an empty string.

$group: (optional) The group this message belongs to. Defaults to 'Other'.

Return value

TRUE on pass, FALSE on fail.

4 calls to FilterUnitTestCase::assertNoNormalized()
FilterUnitTestCase::testFilterXSS in modules/filter/filter.test
Tests limiting allowed tags and XSS prevention.
FilterUnitTestCase::testFilterXSSAdmin in modules/filter/filter.test
Tests the loose, admin HTML filter.
FilterUnitTestCase::testHtmlFilter in modules/filter/filter.test
Tests filter settings, defaults, access restrictions and similar.
FilterUnitTestCase::testNoFollowFilter in modules/filter/filter.test
Tests the spam deterrent.


modules/filter/filter.test, line 1880
Tests for filter.module.


Unit tests for core filters.


function assertNoNormalized($haystack, $needle, $message = '', $group = 'Other') {
  return $this->assertTrue(strpos(strtolower(decode_entities($haystack)), $needle) === FALSE, $message, $group);