2009-07-19 03:48:25 +00:00
|
|
|
<?php
|
2009-10-08 16:44:25 +00:00
|
|
|
class PrivMsgTest extends SCoreWebTestCase {
|
2009-07-19 03:48:25 +00:00
|
|
|
function testPM() {
|
|
|
|
$this->log_in_as_admin();
|
|
|
|
$this->get_page("user/test");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->set_field('subject', "message demo to test");
|
|
|
|
$this->set_field('message', "message contents");
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->click("Send");
|
|
|
|
$this->log_out();
|
|
|
|
|
|
|
|
$this->log_in_as_user();
|
|
|
|
$this->get_page("user");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_text("message demo to test");
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->click("message demo to test");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_text("message contents");
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->back();
|
|
|
|
$this->click("Delete");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_no_text("message demo to test");
|
2010-03-22 14:47:37 +00:00
|
|
|
|
|
|
|
$this->get_page("pm/read/0");
|
|
|
|
$this->assert_text("No such PM");
|
|
|
|
$this->get_page("pm/delete/0");
|
|
|
|
$this->assert_text("No such PM");
|
|
|
|
$this->get_page("pm/waffle/0");
|
|
|
|
$this->assert_text("Invalid action");
|
|
|
|
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->log_out();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testAdminAccess() {
|
|
|
|
$this->log_in_as_admin();
|
|
|
|
$this->get_page("user/test");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->set_field('subject', "message demo to test");
|
|
|
|
$this->set_field('message', "message contents");
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->click("Send");
|
|
|
|
|
|
|
|
$this->get_page("user/test");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_text("message demo to test");
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->click("message demo to test");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_text("message contents");
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->back();
|
|
|
|
$this->click("Delete");
|
2009-07-19 16:59:57 +00:00
|
|
|
|
|
|
|
# simpletest bug? - redirect(referrer) works in opera, not in
|
|
|
|
# webtestcase, so we end up at the wrong page...
|
|
|
|
$this->get_page("user/test");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title("test's Page");
|
|
|
|
$this->assert_no_text("message demo to test");
|
2009-07-19 03:48:25 +00:00
|
|
|
$this->log_out();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|