summaryrefslogtreecommitdiff
path: root/modules/gallery_unit_test/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-01-17 15:05:46 -0500
committerBharat Mediratta <bharat@menalto.com>2013-01-17 15:05:46 -0500
commitd04080c7be7c8a06bd81a9747943600812339f40 (patch)
treeb1147aaafda9938277cd859ae8d78e6e55255517 /modules/gallery_unit_test/helpers
parent9d684b7b83f0aa026e9d6f06228294f179a3bcaa (diff)
Follow-on to 94b26e506c339f50b8d094057bffc1877a79afa9 - make the new legal_file
functions more robust when passed an unknown extension. Fixes Item_Model_Test.
Diffstat (limited to 'modules/gallery_unit_test/helpers')
-rw-r--r--modules/gallery_unit_test/helpers/test.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/gallery_unit_test/helpers/test.php b/modules/gallery_unit_test/helpers/test.php
index 7fba0eda..8a2044a9 100644
--- a/modules/gallery_unit_test/helpers/test.php
+++ b/modules/gallery_unit_test/helpers/test.php
@@ -33,6 +33,21 @@ class test_Core {
return test::random_album_unsaved($parent)->save()->reload();
}
+ static function random_movie_unsaved($parent=null) {
+ $rand = test::random_string(6);
+ $photo = ORM::factory("item");
+ $photo->type = "movie";
+ $photo->parent_id = $parent ? $parent->id : 1;
+ $photo->set_data_file(MODPATH . "gallery/tests/test.flv");
+ $photo->name = "name_$rand.flv";
+ $photo->title = "title_$rand";
+ return $photo;
+ }
+
+ static function random_movie($parent=null) {
+ return test::random_movie_unsaved($parent)->save()->reload();
+ }
+
static function random_photo_unsaved($parent=null) {
$rand = test::random_string(6);
$photo = ORM::factory("item");