From 32b6780d6e75a39e62784cec998ee2b5f69ee77e Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 27 Nov 2011 01:10:09 -0500 Subject: Added prep_url and auto_link tests --- tests/codeigniter/helpers/url_helper_test.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/codeigniter') 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' => 'http://www.codeigniter.com 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 -- cgit v1.2.3-24-g4f1b