diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codeigniter/libraries/Form_validation_test.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/codeigniter/libraries/Form_validation_test.php b/tests/codeigniter/libraries/Form_validation_test.php index ab0e1fc0a..afd070e05 100644 --- a/tests/codeigniter/libraries/Form_validation_test.php +++ b/tests/codeigniter/libraries/Form_validation_test.php @@ -43,7 +43,6 @@ class Form_validation_test extends CI_TestCase { // Empty, not required $this->assertTrue($this->run_rules($rules, array('foo' => ''))); - // Not required, but also not empty $this->assertTrue($this->run_rules($rules, array('foo' => '123'))); $this->assertFalse($this->run_rules($rules, array('foo' => 'bar'))); @@ -56,6 +55,13 @@ class Form_validation_test extends CI_TestCase { $this->assertFalse($this->run_rules($rules, array('foo' => 'bar'))); } + public function test_rule_is_array() + { + $rules = array(array('field' => 'foo', 'label' => 'Foo', 'rules' => 'is_array')); + $this->assertTrue($this->run_rules($rules, array('foo' => array('1', '2')))); + $this->assertFalse($this->run_rules($rules, array('foo' => ''))); + } + public function test_rule_matches() { $rules = array( |