summaryrefslogtreecommitdiff
path: root/core/tests/Album_Helper_Test.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-16 03:48:56 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-16 03:48:56 +0000
commit33f1187220404bca6597de5368048316ece5139a (patch)
tree35312d8fcfa501526257fa17a62533cbf390ba51 /core/tests/Album_Helper_Test.php
parent7679811a3143b5e05f78abb0e8ac816c87a36c3a (diff)
Don't allow the various ::create() methods to take "/" in the name.
Diffstat (limited to 'core/tests/Album_Helper_Test.php')
-rw-r--r--core/tests/Album_Helper_Test.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/tests/Album_Helper_Test.php b/core/tests/Album_Helper_Test.php
index d4bfca55..522d58d9 100644
--- a/core/tests/Album_Helper_Test.php
+++ b/core/tests/Album_Helper_Test.php
@@ -58,4 +58,17 @@ class Album_Helper_Test extends Unit_Test_Case {
$album = album::create($root, $rand, $rand, $rand);
$this->assert_equal("http://./var/resizes/$rand/.album.jpg", $album->resize_url());
}
+
+ public function create_album_shouldnt_allow_names_with_slash_test() {
+ $rand = rand();
+ $root = ORM::factory("item", 1);
+ try {
+ $album = album::create($root, $rand . "/", $rand, $rand);
+ } catch (Exception $e) {
+ // pass
+ return;
+ }
+
+ $this->assert_true(false, "Shouldn't create an album with / in the name");
+ }
}