You are here

public static function PHPUnit_Framework_Assert::assertStringMatchesFormatFile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/Assert.php \PHPUnit_Framework_Assert::assertStringMatchesFormatFile()

Asserts that a string matches a given format file.

@since Method available since Release 3.5.0

Parameters

string $formatFile:

string $string:

string $message:

7 calls to PHPUnit_Framework_Assert::assertStringMatchesFormatFile()
FailureTest::testAssertStringMatchesFormatFile in vendor/phpunit/phpunit/tests/_files/FailureTest.php
Framework_AssertTest::testAssertStringMatchesFormatFile in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringMatchesFormatFile
Framework_AssertTest::testAssertStringMatchesFormatFileThrowsExceptionForInvalidArgument in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringMatchesFormatFile @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertStringMatchesFormatFileThrowsExceptionForInvalidArgument2 in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringMatchesFormatFile @expectedException PHPUnit_Framework_Exception
PHP_CodeCoverage_Report_CloverTest::testCloverForBankAccountTest in vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/CloverTest.php
@covers PHP_CodeCoverage_Report_Clover

... See full list

File

vendor/phpunit/phpunit/src/Framework/Assert.php, line 1553

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertStringMatchesFormatFile($formatFile, $string, $message = '') {
  self::assertFileExists($formatFile, $message);
  if (!is_string($string)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string');
  }
  $constraint = new PHPUnit_Framework_Constraint_StringMatches(file_get_contents($formatFile));
  self::assertThat($string, $constraint, $message);
}