lithium\test\Unit::assertPattern()

public method

Assert that the regular expression $expected is matched in the result.

Parameters

  • mixed $expected
  • mixed $result
  • string $message

Returns

boolean

true if the assertion succeeded, false otherwise.

Source

	public function assertPattern($expected, $result, $message = '{:message}') {
		list($expected, $result) = $this->_normalizeLineEndings($expected, $result);
		$params = compact('expected', 'result');
		return $this->assert(!!preg_match($expected, $result), $message, $params);
	}