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

30 lines
724 B
PHP
Raw Normal View History

<?php
class IPBanTest extends SCoreWebTestCase {
function testIPBan() {
2012-03-09 22:08:55 +00:00
$this->get_page('ip_ban/list');
2009-08-19 00:28:48 +00:00
$this->assert_response(403);
$this->assert_title("Permission Denied");
2012-03-09 22:08:55 +00:00
$this->log_in_as_admin();
2012-03-09 22:08:55 +00:00
$this->get_page('ip_ban/list');
2009-08-19 00:28:48 +00:00
$this->assert_no_text("42.42.42.42");
$this->set_field('ip', '42.42.42.42');
$this->set_field('reason', 'unit testing');
$this->set_field('end', '1 week');
$this->click("Ban");
2009-01-04 19:18:37 +00:00
2009-08-19 00:28:48 +00:00
$this->assert_text("42.42.42.42");
$this->click("Remove"); // FIXME: remove which ban? :S
2009-08-19 00:28:48 +00:00
$this->assert_no_text("42.42.42.42");
2012-03-09 22:08:55 +00:00
$this->get_page('ip_ban/list?all=on'); // just test it doesn't crash for now
2009-09-27 14:48:38 +00:00
$this->log_out();
2009-07-20 05:51:36 +00:00
# FIXME: test that the IP is actually banned
}
}