From f492436317a61aa8387d1fb2232f8e5255ed5d3c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 18 Jan 2010 13:03:59 -0800 Subject: Add random_name(). --- modules/gallery_unit_test/helpers/test.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/gallery_unit_test') 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; + } } -- cgit v1.2.3