summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers/url_helper_test.php
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2011-11-27 06:59:07 +0100
committerEric Barnes <eric@ericlbarnes.com>2011-11-27 06:59:07 +0100
commit940761464e6f7788bdce0bad55f41850ad73eb89 (patch)
treeac9415821e69175bd717265906bc81877c7d94fe /tests/codeigniter/helpers/url_helper_test.php
parent051a317e1e51c2ab50920e3ced50732bc7041bd7 (diff)
Added tests for removing extra dashes in url title.
Diffstat (limited to 'tests/codeigniter/helpers/url_helper_test.php')
-rw-r--r--tests/codeigniter/helpers/url_helper_test.php16
1 files changed, 14 insertions, 2 deletions
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