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

@ -87,25 +87,20 @@ class CommentListTest extends ShimmiePHPUnitTestCase
public function testSingleDel()
{
$this->markTestIncomplete();
global $database, $user;
$this->log_in_as_admin();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
# make a comment
$this->get_page("post/view/$image_id");
$this->set_field('comment', "Test Comment ASDFASDF");
$this->click("Post Comment");
$this->assert_title("Image $image_id: pbx");
send_event(new CommentPostingEvent($image_id, $user, "Test Comment ASDFASDF"));
$page = $this->get_page("post/view/$image_id");
$this->assert_text("ASDFASDF");
# delete it
$this->click("Del");
$this->assert_title("Image $image_id: pbx");
# delete a comment
$comment_id = (int)$database->get_one("SELECT id FROM comments");
send_event(new CommentDeletionEvent($comment_id));
$page = $this->get_page("post/view/$image_id");
$this->assert_no_text("ASDFASDF");
# tidy up
$this->delete_image($image_id);
$this->log_out();
}
}