2008-10-11 07:09:42 +00:00
|
|
|
<?php
|
2009-07-21 06:36:12 +00:00
|
|
|
class UserPageTest extends SCoreWebTestCase {
|
2008-10-11 07:09:42 +00:00
|
|
|
function testUserPage() {
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->get_page('user');
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title("Not Logged In");
|
|
|
|
$this->assert_no_text("Options");
|
|
|
|
$this->assert_no_text("More Options");
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->get_page('user/demo');
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title("demo's Page");
|
2012-03-09 18:15:03 +00:00
|
|
|
$this->assert_text("Joined:");
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->get_page('user/MauMau');
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title("No Such User");
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_in_as_user();
|
2008-10-11 07:09:42 +00:00
|
|
|
// should be on the user page
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title(USER_NAME+"'s Page");
|
|
|
|
$this->assert_text("Options");
|
2012-03-09 18:15:03 +00:00
|
|
|
// FIXME: check class
|
|
|
|
//$this->assert_no_text("Admin:");
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_out();
|
2008-10-11 07:09:42 +00:00
|
|
|
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_in_as_admin();
|
2008-10-11 07:09:42 +00:00
|
|
|
// should be on the user page
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title(ADMIN_NAME+"'s Page");
|
|
|
|
$this->assert_text("Options");
|
2012-03-09 18:15:03 +00:00
|
|
|
// FIXME: check class
|
|
|
|
//$this->assert_text("Admin:");
|
2009-07-15 01:42:18 +00:00
|
|
|
$this->log_out();
|
2009-07-20 05:51:36 +00:00
|
|
|
|
|
|
|
# FIXME: test user creation
|
|
|
|
# FIXME: test adminifying
|
|
|
|
# FIXME: test password reset
|
2009-09-20 02:48:24 +00:00
|
|
|
|
2009-10-26 10:49:07 +00:00
|
|
|
$this->get_page('user_admin/list');
|
2009-09-20 02:48:24 +00:00
|
|
|
$this->assert_text("demo");
|
2008-10-11 07:09:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|