function FilterKernelTest::assertNoNormalized
Same name and namespace in other branches
- 9 core/modules/filter/tests/src/Kernel/FilterKernelTest.php \Drupal\Tests\filter\Kernel\FilterKernelTest::assertNoNormalized()
- 10 core/modules/filter/tests/src/Kernel/FilterKernelTest.php \Drupal\Tests\filter\Kernel\FilterKernelTest::assertNoNormalized()
- 11.x core/modules/filter/tests/src/Kernel/FilterKernelTest.php \Drupal\Tests\filter\Kernel\FilterKernelTest::assertNoNormalized()
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.
Parameters
string $haystack: Text to look in.
string $needle: Lowercase, plain text to look for.
string $message: (optional) Message to display if failed. Defaults to an empty string.
string $group: (optional) The group this message belongs to. Defaults to 'Other'.
Return value
bool TRUE on pass, FALSE on fail.
2 calls to FilterKernelTest::assertNoNormalized()
- FilterKernelTest::testHtmlFilter in core/
modules/ filter/ tests/ src/ Kernel/ FilterKernelTest.php - Tests filter settings, defaults, access restrictions and similar.
- FilterKernelTest::testNoFollowFilter in core/
modules/ filter/ tests/ src/ Kernel/ FilterKernelTest.php - Tests the spam deterrent.
File
-
core/
modules/ filter/ tests/ src/ Kernel/ FilterKernelTest.php, line 1170
Class
- FilterKernelTest
- Tests Filter module filters individually.
Namespace
Drupal\Tests\filter\KernelCode
public function assertNoNormalized($haystack, $needle, $message = '', $group = 'Other') {
return $this->assertStringNotContainsString($needle, strtolower(Html::decodeEntities($haystack)), $message);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.