summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-18 13:03:59 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-18 13:03:59 -0800
commitf492436317a61aa8387d1fb2232f8e5255ed5d3c (patch)
treeb468b37b847a3c67c5930247085b6e588d7ef4c6
parent92ed5d45e6e81b39f4d6b8621c36b597a1b315d8 (diff)
Add random_name().
-rw-r--r--modules/gallery_unit_test/helpers/test.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gallery_unit_test/helpers/test.php b/modules/gallery_unit_test/helpers/test.php
index 5368539f..29a7a79a 100644
--- a/modules/gallery_unit_test/helpers/test.php
+++ b/modules/gallery_unit_test/helpers/test.php
@@ -47,4 +47,12 @@ class test_Core {
static function random_photo($parent=null) {
return test::random_photo_unsaved($parent)->save();
}
+
+ static function random_name($item=null) {
+ $rand = "name_" . rand();
+ if ($item && $item->is_photo()) {
+ $rand .= ".jpg";
+ }
+ return $rand;
+ }
}