summaryrefslogtreecommitdiff
path: root/modules/user/tests
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-12 00:59:30 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-12 00:59:30 +0000
commit2cf3233f546dfa38521bd9ec280dbec9a9fb7612 (patch)
treed002407e665c966bb3ccfeedd672ba77fd26541c /modules/user/tests
parent0f41cab73201ca2669f4cce88d7e195d7cb28285 (diff)
Get rid of all pseudo users and pseudo groups, while preserving all
other functionality. This makes our user/group and access code fully consistent.
Diffstat (limited to 'modules/user/tests')
-rw-r--r--modules/user/tests/User_Installer_Test.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/modules/user/tests/User_Installer_Test.php b/modules/user/tests/User_Installer_Test.php
index acc5467f..db86f0f2 100644
--- a/modules/user/tests/User_Installer_Test.php
+++ b/modules/user/tests/User_Installer_Test.php
@@ -25,21 +25,34 @@
class User_Installer_Test extends Unit_Test_Case {
public function install_creates_admin_user_test() {
$user = ORM::factory("user", 1);
- $this->assert_equal("Gallery Administrator", $user->display_name);
+ $this->assert_equal("guest", $user->name);
+ $this->assert_true($user->guest);
+
+ $user = ORM::factory("user", 2);
$this->assert_equal("admin", $user->name);
- $this->assert_true(user::is_correct_password($user, "admin"));
+ $this->assert_false($user->guest);
$this->assert_equal(
- array("Registered Users"),
+ array("Everybody", "Registered Users"),
array_keys($user->groups->select_list("name")));
}
- public function install_creates_registered_group_test() {
+ public function install_creates_everybody_group_test() {
$group = ORM::factory("group", 1);
+ $this->assert_equal("Everybody", $group->name);
+ $this->assert_true($group->special);
+
+ $this->assert_equal(
+ array("guest", "admin"),
+ array_keys($group->users->select_list("name")));
+ }
+
+ public function install_creates_registered_group_test() {
+ $group = ORM::factory("group", 2);
$this->assert_equal("Registered Users", $group->name);
$this->assert_equal(
- array("admin", "joe"),
+ array("admin"),
array_keys($group->users->select_list("name")));
}
}