This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/contrib/pm/test.php

45 lines
1.2 KiB
PHP
Raw Normal View History

2009-07-19 03:48:25 +00:00
<?php
class PMTest extends ShimmieWebTestCase {
function testPM() {
$this->log_in_as_admin();
$this->get_page("user/test");
$this->setField('subject', "message demo to test");
$this->setField('message', "message contents");
$this->click("Send");
$this->log_out();
$this->log_in_as_user();
$this->get_page("user");
$this->assertText("message demo to test");
$this->click("message demo to test");
$this->assertText("message contents");
$this->back();
$this->click("Delete");
$this->assertNoText("message demo to test");
$this->log_out();
}
function testAdminAccess() {
$this->log_in_as_admin();
$this->get_page("user/test");
$this->setField('subject', "message demo to test");
$this->setField('message', "message contents");
$this->click("Send");
$this->get_page("user/test");
$this->assertText("message demo to test");
$this->click("message demo to test");
$this->assertText("message contents");
$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");
$this->assertTitle("test's Page");
2009-07-19 03:48:25 +00:00
$this->assertNoText("message demo to test");
$this->log_out();
}
}
?>