fix all the tests (for sqlite, php7.4, osx, at least)

This commit is contained in:
Shish
2020-01-28 21:19:59 +00:00
parent ac1076b3f3
commit 615da9e9d2
57 changed files with 665 additions and 859 deletions

View File

@@ -3,41 +3,36 @@ class ReportImageTest extends ShimmiePHPUnitTestCase
{
public function testReportImage()
{
$this->log_in_as_user();
global $config, $database, $user;
$this->log_in_as_admin();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
$this->get_page("post/view/$image_id");
$this->markTestIncomplete();
// Add image report
send_event(new AddReportedImageEvent(new ImageReport($image_id, $user->id, "report details")));
$this->set_field('reason', "report details");
$this->click("Report");
$this->log_out();
$this->log_in_as_admin();
$this->get_page("setup");
$this->set_field("_config_report_image_show_thumbs", true);
$this->click("Save Settings");
// Check that the report exists
$config->set_bool("report_image_show_thumbs", true);
$this->get_page("image_report/list");
$this->assert_title("Reported Images");
$this->assert_text("report details");
$this->get_page("setup");
$this->set_field("_config_report_image_show_thumbs", false);
$this->click("Save Settings");
$config->set_bool("report_image_show_thumbs", false);
$this->get_page("image_report/list");
$this->assert_title("Reported Images");
$this->assert_text("report details");
$this->assert_text("$image_id");
// Remove report
$report_id = (int)$database->get_one("SELECT id FROM image_reports");
send_event(new RemoveReportedImageEvent($report_id));
// Check that the report is gone
$this->get_page("image_report/list");
$this->click("Remove Report");
$this->assert_title("Reported Images");
$this->assert_no_text("report details");
$this->delete_image($image_id);
$this->log_out();
# FIXME: test delete image from report screen
# FIXME: test that >>123 works
}