DrupalWebTestCase::assertNoPattern

  1. drupal
    1. 8
    2. 7
Versions
7 protected DrupalWebTestCase::assertNoPattern($pattern, $message = '', $group = 'Other')

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.

Code

modules/simpletest/drupal_web_test_case.php, line 2889

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