assertTrue(Security::has_default_admin()); $this->assertTrue( Security::check_default_admin('admin', 'password'), 'Succeeds with correct username and password' ); $this->assertFalse( Security::check_default_admin('wronguser', 'password'), 'Fails with incorrect username' ); $this->assertFalse( Security::check_default_admin('admin', 'wrongpassword'), 'Fails with incorrect password' ); Security::setDefaultAdmin(null, null); } function testFindAnAdministratorCreatesNewUser() { $adminMembers = Permission::get_members_by_permission('ADMIN'); $this->assertFalse($adminMembers); $admin = Security::findAnAdministrator(); $this->assertInstanceOf('Member', $admin); $this->assertTrue(Permission::checkMember($admin, 'ADMIN')); $this->assertNull($admin->Email); $this->assertNull($admin->Password); } }