mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 13:02:40 +00:00
Restoring the validationErrors property in FormHelper, it will be checked first before the validation errors in the model
This commit is contained in:
parent
84aba009e7
commit
d5ce09cd96
2 changed files with 48 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue