protected function DrupalWebTestCase::assertNoPattern in Drupal 7
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 3424
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);
}