public static function PHPUnit_Framework_Assert::assertRegExp

Asserts that a string matches a given regular expression.

Parameters

string $pattern:

string $string:

string $message:

5 calls to PHPUnit_Framework_Assert::assertRegExp()
Framework_AssertTest::testAssertRegExp in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertRegExp
Framework_AssertTest::testAssertRegExpThrowsException in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertRegExp @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertRegExpThrowsException2 in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertRegExp @expectedException PHPUnit_Framework_Exception
PHPUnit_Framework_TestCase::runBare in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php
Runs the bare test sequence.
Util_TypeTest::testNonBinaryStringExport in drupal/core/vendor/phpunit/phpunit/Tests/Util/TypeTest.php
@dataProvider provideNonBinaryMultibyteStrings

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php, line 1336

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertRegExp($pattern, $string, $message = '') {
  if (!is_string($pattern)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
  }
  if (!is_string($string)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string');
  }
  $constraint = new PHPUnit_Framework_Constraint_PCREMatch($pattern);
  self::assertThat($string, $constraint, $message);
}