diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-16 03:37:14 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-16 03:37:14 +0000 |
commit | 7679811a3143b5e05f78abb0e8ac816c87a36c3a (patch) | |
tree | c2453ff14f03c15dbdfe157661d88afe1c7d4fd3 /core/tests | |
parent | 59db5456d42d3a300cce661a9b5f7da069c26893 (diff) |
Item_Model::rename() cannot accept new filenames that contain "/"
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/Item_Model_Test.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/tests/Item_Model_Test.php b/core/tests/Item_Model_Test.php index 40915360..615b8997 100644 --- a/core/tests/Item_Model_Test.php +++ b/core/tests/Item_Model_Test.php @@ -125,4 +125,19 @@ class Item_Model_Test extends Unit_Test_Case { $this->assert_equal("resize", file_get_contents($photo->resize_path())); $this->assert_equal("file", file_get_contents($photo->file_path())); } + + public function item_rename_wont_accept_slash_test() { + // Create a test photo + $item = self::create_random_item(); + + $new_name = rand() . "/"; + + try { + $item->rename($new_name)->save(); + } catch (Exception $e) { + // pass + return; + } + $this->assert_false(true, "Item_Model::rename should not accept / characters"); + } } |