summaryrefslogtreecommitdiff
path: root/modules/gallery_unit_test/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-20 21:15:57 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-20 21:15:57 -0800
commit2a41e27d49bd9f5f341ee201ec3878767a9271ec (patch)
treee68540f146cbb43aec389d9a0f57879513d494df /modules/gallery_unit_test/helpers
parent3a26ace065476fbc9c2537e97bf7720d3648400f (diff)
Add random_tag().
Diffstat (limited to 'modules/gallery_unit_test/helpers')
-rw-r--r--modules/gallery_unit_test/helpers/test.php8
1 files changed, 8 insertions, 0 deletions
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();
+ }
}