diff options
author | Andrey Andreev <narf@devilix.net> | 2017-06-21 14:29:25 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-06-21 14:29:25 +0200 |
commit | 56c233fc4a455d33d2e679b59132b8a7a1cf1832 (patch) | |
tree | e0071a7a0a96fa375ee6c352f25bf6d18e426585 /tests/codeigniter/libraries/Form_validation_test.php | |
parent | f39cb00559b86f956737c62ec1dcbc9aab29ebb9 (diff) |
Implement #193: Validating entire arrays in a single function call
Diffstat (limited to 'tests/codeigniter/libraries/Form_validation_test.php')
-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( |