From 940761464e6f7788bdce0bad55f41850ad73eb89 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 27 Nov 2011 00:59:07 -0500 Subject: Added tests for removing extra dashes in url title. --- tests/codeigniter/helpers/url_helper_test.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests/codeigniter') diff --git a/tests/codeigniter/helpers/url_helper_test.php b/tests/codeigniter/helpers/url_helper_test.php index ea3fb0e4f..b5384eaef 100644 --- a/tests/codeigniter/helpers/url_helper_test.php +++ b/tests/codeigniter/helpers/url_helper_test.php @@ -10,13 +10,25 @@ class Url_helper_test extends CI_TestCase 'foo bar /' => 'foo-bar', '\ testing 12' => 'testing-12' ); - + foreach ($words as $in => $out) { $this->assertEquals($out, url_title($in, 'dash', TRUE)); - } + } } // -------------------------------------------------------------------- + public function test_url_title_extra_dashes() + { + $words = array( + '_foo bar_' => 'foo_bar', + '_What\'s wrong with CSS?_' => 'Whats_wrong_with_CSS' + ); + + foreach ($words as $in => $out) + { + $this->assertEquals($out, url_title($in, 'underscore')); + } + } } \ No newline at end of file -- cgit v1.2.3-24-g4f1b