error() public method

Add an error to error messages array
public error ( string $field, string $msg, array $params = [] )
$field string
$msg string
$params array
示例#1
0
 /**
  * @dataProvider dataProviderFor_testError
  */
 public function testError($expected, $input, $test, $message)
 {
     $v = new Validator(array('test' => $input));
     $v->error('test', $message, $test);
     $this->assertEquals(array('test' => array($expected)), $v->errors());
 }