diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-18 13:03:59 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-18 13:03:59 -0800 |
commit | f492436317a61aa8387d1fb2232f8e5255ed5d3c (patch) | |
tree | b468b37b847a3c67c5930247085b6e588d7ef4c6 /modules/gallery_unit_test/helpers/test.php | |
parent | 92ed5d45e6e81b39f4d6b8621c36b597a1b315d8 (diff) |
Add random_name().
Diffstat (limited to 'modules/gallery_unit_test/helpers/test.php')
-rw-r--r-- | modules/gallery_unit_test/helpers/test.php | 8 |
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; + } } |