lithium\test\Unit::assertStringNotMatchesFormat()
Assert that given value does not matche the sprintf
format.
$this->assertStringNotMatchesFormat('%d', '10.555'); // succeeds
$this->assertStringNotMatchesFormat('%d', '10'); // fails
Parameters
-
string
$expected
Expected format using sscanf's format.
-
string
$actual
-
string|boolean
$message
Returns
booleantrue
if the assertion succeeded, false
otherwise.
Links
Source
public function assertStringNotMatchesFormat($expected, $actual, $message = '{:message}') {
$result = sscanf($actual, $expected);
return $this->assert($result[0] != $actual, $message, compact('expected', 'result'));
}