summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core/Input_test.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 20:29:23 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 20:29:23 +0200
commit3427797a2899506adbe5317671fe0b3c27c2a6a6 (patch)
tree199fd08da90a1e37f5c7f4d75e4af957dc5e7278 /tests/codeigniter/core/Input_test.php
parent968690491f625ddf59a5136b55ae1b9a2cf98a9a (diff)
parent25d47aec0417e52af43985663ebc1f62931f13cd (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-sqlite
Diffstat (limited to 'tests/codeigniter/core/Input_test.php')
-rw-r--r--tests/codeigniter/core/Input_test.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/codeigniter/core/Input_test.php b/tests/codeigniter/core/Input_test.php
index cfc80c950..c9322c027 100644
--- a/tests/codeigniter/core/Input_test.php
+++ b/tests/codeigniter/core/Input_test.php
@@ -143,4 +143,19 @@ class Input_test extends CI_TestCase {
$this->assertEquals("Hello, i try to <script>alert('Hack');</script> your site", $harm);
$this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $harmless);
}
+
+ // --------------------------------------------------------------------
+
+ public function test_valid_ip()
+ {
+ $ip_v4 = '192.18.0.1';
+ $this->assertTrue($this->input->valid_ip($ip_v4));
+
+ $ip_v6 = array('2001:0db8:0000:85a3:0000:0000:ac1f:8001', '2001:db8:0:85a3:0:0:ac1f:8001', '2001:db8:0:85a3::ac1f:8001');
+ foreach($ip_v6 as $ip)
+ {
+ $this->assertTrue($this->input->valid_ip($ip));
+ }
+ }
+
} \ No newline at end of file