You are here

function DrupalTestCase::assertNoUnwantedPattern in SimpleTest 6

Same name and namespace in other branches
  1. 5 drupal_test_case.php \DrupalTestCase::assertNoUnwantedPattern()

Will trigger a pass if the Perl regex pattern is not present in subject. Fail if found.

Parameters

string $pattern Perl regex to look for including: the regex delimiters. @param string $subject String to search in. @param string $message Message to display. @return boolean True on pass @access public

File

./drupal_test_case.php, line 749

Class

DrupalTestCase
Test case for typical Drupal tests. Extends WebTestCase for comfortable browser usage but also implements all UnitTestCase methods, I wish WebTestCase would do this.

Code

function assertNoUnwantedPattern($pattern, $subject, $message = "%s") {
  return $this
    ->assertExpectation(new UnwantedPatternExpectation($pattern), $subject, $message);
}