PHPUnit_Framework_Assert::assertStringNotMatchesFormat PHP Method

assertStringNotMatchesFormat() public static method

Asserts that a string does not match a given format string.
public static assertStringNotMatchesFormat ( string $format, string $string, string $message = '' )
$format string
$string string
$message string
    public static function assertStringNotMatchesFormat($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_Not(new PHPUnit_Framework_Constraint_StringMatches($format));
        static::assertThat($string, $constraint, $message);
    }

Usage Example

Example #1
0
/**
 * Asserts that a string does not match a given format string.
 *
 * @param  string $format
 * @param  string $string
 * @param  string $message
 * @since  Method available since Release 3.5.0
 */
function assertStringNotMatchesFormat($format, $string, $message = '')
{
    return PHPUnit_Framework_Assert::assertStringNotMatchesFormat($format, $string, $message);
}
All Usage Examples Of PHPUnit_Framework_Assert::assertStringNotMatchesFormat
PHPUnit_Framework_Assert