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/ext/user/test.php

37 lines
994 B
PHP
Raw Normal View History

<?php
class UserPageTest extends WebTestCase {
function testUserPage() {
2009-01-04 19:38:47 +00:00
$this->get(TEST_BASE.'/user');
$this->assertTitle("Anonymous's Page");
$this->assertNoText("Options");
$this->assertNoText("More Options");
2009-01-04 19:38:47 +00:00
$this->get(TEST_BASE.'/user/Shish');
$this->assertTitle("Shish's Page");
2009-01-04 19:38:47 +00:00
$this->get(TEST_BASE.'/user/MauMau');
$this->assertTitle("No Such User");
$this->assertText("Login");
$this->setField('user', USER_NAME);
$this->setField('pass', USER_PASS);
$this->click("Log In");
// should be on the user page
2009-01-04 19:38:47 +00:00
$this->assertTitle("test's Page");
$this->assertText("Options");
$this->assertNoText("More Options");
$this->click('Log Out');
$this->assertText("Login");
$this->setField('user', ADMIN_NAME);
$this->setField('pass', ADMIN_PASS);
$this->click("Log In");
// should be on the user page
2009-01-04 19:38:47 +00:00
$this->assertTitle(ADMIN_NAME+"'s Page");
$this->assertText("Options");
$this->assertText("More Options");
$this->click('Log Out');
}
}
?>