summaryrefslogtreecommitdiff
path: root/core/tests/Photo_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/Photo_Helper_Test.php
parent7679811a3143b5e05f78abb0e8ac816c87a36c3a (diff)
Don't allow the various ::create() methods to take "/" in the name.
Diffstat (limited to 'core/tests/Photo_Helper_Test.php')
-rw-r--r--core/tests/Photo_Helper_Test.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/tests/Photo_Helper_Test.php b/core/tests/Photo_Helper_Test.php
index 45e911b2..81405b79 100644
--- a/core/tests/Photo_Helper_Test.php
+++ b/core/tests/Photo_Helper_Test.php
@@ -80,4 +80,18 @@ class Photo_Helper_Test extends Unit_Test_Case {
$this->assert_equal("http://./var/resizes/{$rand}/{$rand}.jpg", $photo->resize_url());
}
+
+ public function create_photo_shouldnt_allow_names_with_slash_test() {
+ $rand = rand();
+ $root = ORM::factory("item", 1);
+ try {
+ $filename = DOCROOT . "core/tests/test.jpg";
+ $photo = photo::create($root, $filename, "$rand/.jpg", $rand, $rand);
+ } catch (Exception $e) {
+ // pass
+ return;
+ }
+
+ $this->assert_true(false, "Shouldn't create a photo with / in the name");
+ }
}