diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-10 22:08:02 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-10 22:08:02 +0000 |
commit | db6917b58b0533214560ffef7334f4dc5e9a7cc7 (patch) | |
tree | eae03a9e29990e7c474c62801bbbb25018f6a513 /modules/user/tests | |
parent | 253ae3e0034bc94a7d2d072bb9bee38aa9403ad1 (diff) |
Use select_list() to allow for a single assert_equal in our tests.
Diffstat (limited to 'modules/user/tests')
-rw-r--r-- | modules/user/tests/User_Installer_Test.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/modules/user/tests/User_Installer_Test.php b/modules/user/tests/User_Installer_Test.php index 4b653307..84699c74 100644 --- a/modules/user/tests/User_Installer_Test.php +++ b/modules/user/tests/User_Installer_Test.php @@ -19,7 +19,7 @@ */ /** - * This test case operates under the assumption that core_installer::install() is called by the + * This test case operates under the assumption that user_installer::install() is called by the * test controller before it starts. */ class User_Installer_Test extends Unit_Test_Case { @@ -28,28 +28,26 @@ class User_Installer_Test extends Unit_Test_Case { $this->assert_equal("Gallery Administrator", $user->display_name); $this->assert_equal("admin", $user->name); - $groups = $user->groups->as_array(); - $this->assert_equal(2, count($groups)); - $this->assert_equal("administrator", $groups[0]->name); - - $this->assert_equal("registered", $groups[1]->name); + $this->assert_equal( + array("administrator", "registered"), + array_keys($user->groups->select_list("name"))); } public function install_creates_admininstrator_group_test() { $group = ORM::factory("group", 1); $this->assert_equal("administrator", $group->name); - $users = $group->users->as_array(); - $this->assert_equal(1, count($users)); - $this->assert_equal("admin", $users[0]->name); + $this->assert_equal( + array("admin"), + array_keys($group->users->select_list("name"))); } public function install_creates_registered_group_test() { $group = ORM::factory("group", 2); $this->assert_equal("registered", $group->name); - $users = $group->users->as_array(); - $this->assert_equal(1, count($users)); - $this->assert_equal("admin", $users[0]->name); + $this->assert_equal( + array("admin"), + array_keys($group->users->select_list("name"))); } } |