Restoring the validationErrors property in FormHelper, it will be checked first before the validation errors in the model

This commit is contained in:
Jose Lorenzo Rodriguez 2011-07-15 18:24:27 -04:30
parent 84aba009e7
commit d5ce09cd96
2 changed files with 48 additions and 5 deletions

View file

@ -7318,4 +7318,15 @@ class FormHelperTest extends CakeTestCase {
CakePlugin::unload();
App::build();
}
/**
* Tests that it is possible to set the validation errors directly in the helper for a field
*
* @return void
*/
public function testCustomValidationErrors() {
$this->Form->validationErrors['Thing']['field'] = 'Badness!';
$result = $this->Form->error('Thing.field', null, array('wrap' => false));
$this->assertEquals('Badness!', $result);
}
}