diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-19 22:38:19 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-19 22:38:19 -0800 |
commit | 76da85a1a08cdf065bf186c81ea444d03d6f8935 (patch) | |
tree | 7068ce2265e54fb7af6abac7457309cfa900ef87 /modules/gallery_unit_test | |
parent | a774dc5447a1d90cd5c361e9196ab41fd91f92cf (diff) |
Extend Gallery_Unit_Test_Case instead of Unit_Test_Case.
Diffstat (limited to 'modules/gallery_unit_test')
-rw-r--r-- | modules/gallery_unit_test/helpers/test.php | 11 |
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(); + } } |