summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2011-11-27 07:10:09 +0100
committerEric Barnes <eric@ericlbarnes.com>2011-11-27 07:10:09 +0100
commit32b6780d6e75a39e62784cec998ee2b5f69ee77e (patch)
treed1921e1a00824fc0b9a9589ea932678eb8c98d52 /tests/codeigniter/helpers
parent940761464e6f7788bdce0bad55f41850ad73eb89 (diff)
Added prep_url and auto_link tests
Diffstat (limited to 'tests/codeigniter/helpers')
-rw-r--r--tests/codeigniter/helpers/url_helper_test.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/codeigniter/helpers/url_helper_test.php b/tests/codeigniter/helpers/url_helper_test.php
index b5384eaef..30ba4a417 100644
--- a/tests/codeigniter/helpers/url_helper_test.php
+++ b/tests/codeigniter/helpers/url_helper_test.php
@@ -31,4 +31,27 @@ class Url_helper_test extends CI_TestCase
$this->assertEquals($out, url_title($in, 'underscore'));
}
}
+
+ // --------------------------------------------------------------------
+
+ public function test_prep_url()
+ {
+ $this->assertEquals('http://codeigniter.com', prep_url('codeigniter.com'));
+ $this->assertEquals('http://www.codeigniter.com', prep_url('www.codeigniter.com'));
+ }
+
+ // --------------------------------------------------------------------
+
+ public function test_auto_link_url()
+ {
+ $strings = array(
+ 'www.codeigniter.com test' => '<a href="http://www.codeigniter.com">http://www.codeigniter.com</a> test',
+ 'This is my noreply@codeigniter.com test' => 'This is my noreply@codeigniter.com test',
+ );
+
+ foreach ($strings as $in => $out)
+ {
+ $this->assertEquals($out, auto_link($in, 'url'));
+ }
+ }
} \ No newline at end of file