lithium\test\Unit::assertStringNotMatchesFormat()

public method

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

boolean

true if the assertion succeeded, false otherwise.

Source

	public function assertStringNotMatchesFormat($expected, $actual, $message = '{:message}') {
		$result = sscanf($actual, $expected);
		return $this->assert($result[0] != $actual, $message, compact('expected', 'result'));
	}