From 2a41e27d49bd9f5f341ee201ec3878767a9271ec Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 Jan 2010 21:15:57 -0800 Subject: Add random_tag(). --- 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 8e483c60..2bb38b81 100644 --- a/modules/gallery_unit_test/helpers/test.php +++ b/modules/gallery_unit_test/helpers/test.php @@ -70,4 +70,12 @@ class test_Core { call_user_func($callback); return ob_get_clean(); } + + static function random_tag() { + $tag = ORM::factory("tag"); + $tag->name = (string)rand(); + + // have to reload because ORM::load has string versions of values that we set as integers. + return $tag->save()->reload(); + } } -- cgit v1.2.3