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

34 lines
875 B
PHP
Raw Normal View History

2012-03-10 17:40:11 +00:00
<?php
2015-09-20 21:40:04 +00:00
class HashBanTest extends ShimmiePHPUnitTestCase {
2015-09-26 10:17:13 +00:00
public function testBan() {
2012-03-10 17:40:11 +00:00
$this->log_in_as_user();
2015-08-09 11:14:28 +00:00
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
2012-03-10 17:40:11 +00:00
$this->log_out();
$this->log_in_as_admin();
$this->get_page("post/view/$image_id");
2015-09-20 21:40:04 +00:00
$this->markTestIncomplete();
2015-09-20 21:40:04 +00:00
2012-03-10 17:40:11 +00:00
$this->click("Ban and Delete");
$this->log_out();
2012-03-10 17:51:56 +00:00
$this->log_in_as_user();
$this->get_page("post/view/$image_id");
$this->assert_response(404);
2015-08-09 11:14:28 +00:00
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
2012-03-10 17:51:56 +00:00
$this->get_page("post/view/$image_id");
$this->assert_response(404);
$this->log_in_as_admin();
$this->get_page("image_hash_ban/list/1");
$this->click("Remove");
$this->log_in_as_user();
2015-08-09 11:14:28 +00:00
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
2012-03-10 17:51:56 +00:00
$this->get_page("post/view/$image_id");
$this->assert_response(200);
2012-03-10 17:40:11 +00:00
}
}