setup tests

This commit is contained in:
Shish
2015-09-20 20:44:34 +01:00
parent 7bfc959547
commit 2600ef042b
3 changed files with 36 additions and 23 deletions

View File

@ -1,31 +1,39 @@
<?php
class SetupTest {
function testAuth() {
$this->get_page('setup');
$this->assert_response(403);
$this->assert_title("Permission Denied");
class SetupTest extends ShimmiePHPUnitTestCase {
function testNiceUrlsTest() {
# XXX: this only checks that the text is "ok", to check
# for a bug where it was coming out as "\nok"; it doesn't
# check that niceurls actually work
$raw = $this->get_page('nicetest');
$this->assertTrue($raw == "ok");
$this->get_page('nicetest');
$this->assert_content("ok");
$this->assert_no_content("\n");
}
function testAuthAnon() {
$this->get_page('setup');
$this->assert_response(403);
$this->assert_title("Permission Denied");
}
function testAuthUser() {
$this->log_in_as_user();
$this->get_page('setup');
$this->assert_response(403);
$this->assert_title("Permission Denied");
$this->log_out();
}
function testAuthAdmin() {
$this->log_in_as_admin();
$this->get_page('setup');
$this->assert_title("Shimmie Setup");
$this->assert_text("General");
}
function testAdvanced() {
$this->log_in_as_admin();
$this->get_page('setup/advanced');
$this->assert_title("Shimmie Setup");
$this->assert_text("thumb_quality");
$this->log_out();
}
}