function DrupalWebTestCase::assertNoPattern
Will trigger a pass if the perl regex pattern is not present in raw content.
Parameters
$pattern: Perl regex to look for including the regex delimiters.
$message: Message to display.
$group: The group this message belongs to.
Return value
TRUE on pass, FALSE on fail.
4 calls to DrupalWebTestCase::assertNoPattern()
- CommentAnonymous::testAnonymous in modules/
comment/ comment.test - Test anonymous comment functionality.
- ImageFieldDisplayTestCase::testImageFieldDefaultImage in modules/
image/ image.test - Test use of a default image with an image field.
- TaxonomyTermTestCase::testTermInterface in modules/
taxonomy/ taxonomy.test - Save, edit and delete a term using the user interface.
- TrackerTest::testTrackerNewNodes in modules/
tracker/ tracker.test - Tests for the presence of the "new" flag for nodes.
File
-
modules/
simpletest/ drupal_web_test_case.php, line 3490
Class
- DrupalWebTestCase
- Test case for typical Drupal tests.
Code
protected function assertNoPattern($pattern, $message = '', $group = 'Other') {
if (!$message) {
$message = t('Pattern "@pattern" not found', array(
'@pattern' => $pattern,
));
}
return $this->assert(!preg_match($pattern, $this->drupalGetContent()), $message, $group);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.