You are here

protected function DrupalWebTestCase::assertNoPattern in SimpleTest 6.2

Same name and namespace in other branches
  1. 7.2 drupal_web_test_case.php \DrupalWebTestCase::assertNoPattern()
  2. 7 drupal_web_test_case.php \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.

File

./drupal_web_test_case.php, line 2595

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);
}