summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-06-21 14:29:25 +0200
committerAndrey Andreev <narf@devilix.net>2017-06-21 14:29:25 +0200
commit56c233fc4a455d33d2e679b59132b8a7a1cf1832 (patch)
treee0071a7a0a96fa375ee6c352f25bf6d18e426585 /tests/codeigniter/libraries
parentf39cb00559b86f956737c62ec1dcbc9aab29ebb9 (diff)
Implement #193: Validating entire arrays in a single function call
Diffstat (limited to 'tests/codeigniter/libraries')
-rw-r--r--tests/codeigniter/libraries/Form_validation_test.php8
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(