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 77948465..8e483c60 100644
--- a/modules/gallery_unit_test/helpers/test.php
+++ b/modules/gallery_unit_test/helpers/test.php
@@ -48,6 +48,11 @@ class test_Core {
return test::random_photo_unsaved($parent)->save();
}
+ static function random_user($password="password") {
+ $rand = "name_" . rand();
+ return identity::create_user($rand, $rand, $password, "$rand@rand.com");
+ }
+
static function random_name($item=null) {
$rand = "name_" . rand();
if ($item && $item->is_photo()) {
@@ -59,4 +64,10 @@ class test_Core {
static function starts_with($outer, $inner) {
return strpos($outer, $inner) === 0;
}
+
+ static function call_and_capture($callback) {
+ ob_start();
+ call_user_func($callback);
+ return ob_get_clean();
+ }
}