function FilterUnitTestCase::assertNormalized

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

Asserts that a text transformed to lowercase with HTML entities decoded does contains 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 characters that could be used to obscure a tag or an attribute name.

Parameters

$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.

2 calls to FilterUnitTestCase::assertNormalized()
FilterUnitTestCase::testFilterXSS in drupal-7.x/modules/filter/filter.test
Tests limiting allowed tags and XSS prevention.
FilterUnitTestCase::testNoFollowFilter in drupal-7.x/modules/filter/filter.test
Tests the spam deterrent.

File

drupal-7.x/modules/filter/filter.test, line 1816
Tests for filter.module.

Class

FilterUnitTestCase
Unit tests for core filters.

Code

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