From 48becbe017758fb6fb95f0806ece879764249f37 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 8 Sep 2009 20:03:55 -0700 Subject: Update item::convert_filename_to_slug() to eliminate leading and trailing hyphens. --- modules/gallery/tests/Item_Helper_Test.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gallery/tests/Item_Helper_Test.php') 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"); -- cgit v1.2.3