You are here

function DrupalTestCase::assertWantedPattern in SimpleTest 5

Same name and namespace in other branches
  1. 6 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 608

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