public static function PHPUnit_Framework_Assert::assertStringMatchesFormat

Asserts that a string matches a given format string.

@since Method available since Release 3.5.0

Parameters

string $format:

string $string:

string $message:

6 calls to PHPUnit_Framework_Assert::assertStringMatchesFormat()
FailureTest::testAssertStringMatchesFormat in drupal/core/vendor/phpunit/phpunit/Tests/_files/FailureTest.php
Framework_AssertTest::testAssertStringMatchesFormat in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringMatchesFormat
Framework_AssertTest::testAssertStringMatchesFormatFailure in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringMatchesFormat @expectedException PHPUnit_Framework_AssertionFailedError
Framework_AssertTest::testAssertStringNotMatchesFormat in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringNotMatchesFormat
PHP_TimerTest::testResourceUsage in drupal/core/vendor/phpunit/php-timer/Tests/TimerTest.php
@covers PHP_Timer::resourceUsage

... See full list

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

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