diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-21 19:08:40 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-21 19:08:40 -0800 |
commit | 2f9077e26a0d36ac5805db87069827979d965c5f (patch) | |
tree | fac860c3956b7de412a06d4e210910b5986a6cd3 /modules/user/tests | |
parent | 40b17474bbadbaa48f37f8de776e8cbe35efc8e3 (diff) |
Simplify the test using the test helper.
Diffstat (limited to 'modules/user/tests')
-rw-r--r-- | modules/user/tests/User_Groups_Test.php | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/modules/user/tests/User_Groups_Test.php b/modules/user/tests/User_Groups_Test.php index 089ab9a6..d0026d89 100644 --- a/modules/user/tests/User_Groups_Test.php +++ b/modules/user/tests/User_Groups_Test.php @@ -19,32 +19,9 @@ */ class User_Groups_Test extends Gallery_Unit_Test_Case { - public function teardown() { - try { - $group = ORM::factory("group")->where("name", "=", "user_groups_test")->find(); - if ($group->loaded()) { - $group->delete(); - } - } catch (Exception $e) { } - - try { - $user = ORM::factory("user")->where("name", "=", "user_groups_test")->find(); - if ($user->loaded()) { - $user->delete(); - } - } catch (Exception $e) { } - } - public function add_user_to_group_test() { - $user = ORM::factory("user"); - $user->name = "user_groups_test"; - $user->full_name = "user groups test"; - $user->password = "test password"; - $user->save(); - - $group = ORM::factory("group"); - $group->name = "user_groups_test"; - $group->save(); + $user = test::random_user(); + $group = test::random_group(); $group->add($user); $group->save(); |