Skip to content

Commit

Permalink
Update tests for #12024
Browse files Browse the repository at this point in the history
Attempt to capture use case of using `_buildValidator` hook to define
validators.
  • Loading branch information
markstory committed Apr 30, 2018
1 parent 9b16f36 commit 309658f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/TestCase/Form/FormTest.php
Expand Up @@ -136,6 +136,8 @@ public function testValidateDeprected()
{
$this->deprecated(function () {
$form = new ValidateForm();
$this->assertCount(1, $form->validator(), 'should have one rule');

$data = [];
$this->assertFalse($form->validate($data));
$this->assertCount(1, $form->errors());
Expand Down
2 changes: 1 addition & 1 deletion tests/test_app/TestApp/Form/ValidateForm.php
Expand Up @@ -19,7 +19,7 @@
class ValidateForm extends Form
{

public function validator(\Cake\Validation\Validator $validator = null)
protected function _buildValidator(\Cake\Validation\Validator $validator)
{
return parent::validator($validator)
->requirePresence('title');
Expand Down

0 comments on commit 309658f

Please sign in to comment.