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/admin/test.php
2009-01-04 11:42:28 -08:00

26 lines
686 B
PHP

<?php
class AdminPageTest extends WebTestCase {
function testAuth() {
$this->get(TEST_BASE.'/admin');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
$this->assertText("Login");
$this->setField('user', USER_NAME);
$this->setField('pass', USER_PASS);
$this->click("Log In");
$this->get(TEST_BASE.'/admin');
$this->assertResponse(403);
$this->assertTitle("Permission Denied");
$this->click('Log Out');
$this->assertText("Login");
$this->setField('user', ADMIN_NAME);
$this->setField('pass', ADMIN_PASS);
$this->click("Log In");
$this->get(TEST_BASE.'/admin');
$this->assertTitle("Admin Tools");
$this->click('Log Out');
}
}
?>