Skip to content
Permalink
Browse files

Update tests for #12024

Attempt to capture use case of using `_buildValidator` hook to define
validators.
  • Loading branch information...
markstory committed Apr 30, 2018
1 parent 9b16f36 commit 309658fc7bcc4781724534a9224a6195c5342a42
Showing with 3 additions and 1 deletion.
  1. +2 −0 tests/TestCase/Form/FormTest.php
  2. +1 −1 tests/test_app/TestApp/Form/ValidateForm.php
@@ -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());
@@ -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');

0 comments on commit 309658f

Please sign in to comment.
You can’t perform that action at this time.