You are here

function DrupalTestCase::assertWantedPattern in SimpleTest 6

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

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

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 732

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 assertWantedPattern($pattern, $subject, $message = "%s") {
  return $this
    ->assertExpectation(new WantedPatternExpectation($pattern), $subject, $message);
}