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

35 lines
1,007 B
PHP
Raw Normal View History

2009-07-16 19:21:49 +00:00
<?php
class BanWordsTest extends ShimmieWebTestCase {
function testWordBan() {
$this->log_in_as_admin();
$this->get_page("setup");
$this->setField("_config_banned_words", "viagra\nporn\n/http:.*\.cn\//");
$this->click("Save Settings");
$this->log_out();
$this->log_in_as_user();
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx computer screenshot");
$this->get_page("post/view/$image_id");
$this->setField('comment', "kittens and viagra");
$this->click("Post Comment");
$this->assertTitle("Comment Blocked");
$this->get_page("post/view/$image_id");
$this->setField('comment', "some link to http://something.cn/");
$this->click("Post Comment");
$this->assertTitle("Comment Blocked");
$this->get_page('comment/list');
$this->assertTitle('Comments');
$this->assertNoText('viagra');
$this->assertNoText('http://something.cn/');
$this->log_out();
$this->log_in_as_admin();
$this->delete_image($image_id);
$this->log_out();
}
}
?>