summaryrefslogtreecommitdiff
path: root/modules/gallery_unit_test/helpers/test.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery_unit_test/helpers/test.php')
-rw-r--r--modules/gallery_unit_test/helpers/test.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/gallery_unit_test/helpers/test.php b/modules/gallery_unit_test/helpers/test.php
index 2fa12a23..6dfa3cf0 100644
--- a/modules/gallery_unit_test/helpers/test.php
+++ b/modules/gallery_unit_test/helpers/test.php
@@ -28,4 +28,15 @@ class test_Core {
$album->title = "title_$rand";
return $album->save();
}
+
+ static function random_photo($parent=null) {
+ $rand = rand();
+ $photo = ORM::factory("item");
+ $photo->type = "photo";
+ $photo->parent_id = $parent ? $parent->id : 1;
+ $photo->set_data_file(MODPATH . "gallery/tests/test.jpg");
+ $photo->name = "name_$rand.jpg";
+ $photo->title = "title_$rand";
+ return $photo->save();
+ }
}