diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-09-08 20:03:55 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-09-08 20:03:55 -0700 |
commit | 48becbe017758fb6fb95f0806ece879764249f37 (patch) | |
tree | 60a599bdb68c7bc23d97125ff5b665e8b8cd79ce /modules/gallery/tests/Item_Helper_Test.php | |
parent | 453fb76443898746b72a0a2ddd419cf8e54f4207 (diff) |
Update item::convert_filename_to_slug() to eliminate leading and
trailing hyphens.
Diffstat (limited to 'modules/gallery/tests/Item_Helper_Test.php')
-rw-r--r-- | modules/gallery/tests/Item_Helper_Test.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php index 87859565..33fcdb73 100644 --- a/modules/gallery/tests/Item_Helper_Test.php +++ b/modules/gallery/tests/Item_Helper_Test.php @@ -49,6 +49,11 @@ class Item_Helper_Test extends Unit_Test_Case { $this->assert_equal(1, $input->not_url_safe); } + public function convert_filename_to_slug_test() { + $this->assert_equal("foo", item::convert_filename_to_slug("{[foo]}")); + $this->assert_equal("foo-bar", item::convert_filename_to_slug("{[foo!@#!$@#^$@($!(@bar]}")); + } + private static function _create_random_item($album) { // Set all required fields (values are irrelevant) $item = ORM::factory("item"); |