From d04080c7be7c8a06bd81a9747943600812339f40 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 17 Jan 2013 15:05:46 -0500 Subject: Follow-on to 94b26e506c339f50b8d094057bffc1877a79afa9 - make the new legal_file functions more robust when passed an unknown extension. Fixes Item_Model_Test. --- modules/gallery_unit_test/helpers/test.php | 15 +++++++++++++++ 1 file changed, 15 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 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"); -- cgit v1.2.3