From 5d05372f4f59d27fdd93249d813970fcf181a4af Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 20 Oct 2016 13:40:57 +0300 Subject: FV: throw BadMethodCallException when set_rules() called without --- tests/codeigniter/libraries/Form_validation_test.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/codeigniter') diff --git a/tests/codeigniter/libraries/Form_validation_test.php b/tests/codeigniter/libraries/Form_validation_test.php index 0815300e6..5f4bb9316 100644 --- a/tests/codeigniter/libraries/Form_validation_test.php +++ b/tests/codeigniter/libraries/Form_validation_test.php @@ -435,6 +435,12 @@ class Form_validation_test extends CI_TestCase { $this->assertFalse($form_validation->run('fail')); } + public function test_set_rules_exception() + { + $this->setExpectedException('BadMethodCallException'); + $this->form_validation->set_rules('foo', 'bar'); + } + public function test_has_rule() { $this->form_validation->reset_validation(); -- cgit v1.2.3-24-g4f1b