From 1ee7f4ef0cea689114f5fd0b06b369e85061e9b7 Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 4 Dec 2017 18:08:49 +0530 Subject: [PATCH] Add test for Form::setValidator(). --- tests/TestCase/Form/FormTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/TestCase/Form/FormTest.php b/tests/TestCase/Form/FormTest.php index 58b0b1fc3a4..5c49b4f83cf 100644 --- a/tests/TestCase/Form/FormTest.php +++ b/tests/TestCase/Form/FormTest.php @@ -62,6 +62,20 @@ public function testValidator() }); } + /** + * Test setValidator() + * + * @return void + */ + public function testSetValidator() + { + $form = new Form(); + + $validator = $this->getMockBuilder('Cake\Validation\Validator')->getMock(); + $form->setValidator($validator); + $this->assertSame($validator, $form->getValidator()); + } + /** * Test validate method. *