From 91cb704daab114019f51c58f9813827cab678c35 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 27 Sep 2009 15:48:38 +0100 Subject: [PATCH] more testing --- contrib/ban_words/test.php | 4 ++-- contrib/handle_ico/test.php | 2 ++ contrib/handle_svg/test.php | 5 ++++- contrib/ipban/test.php | 2 ++ contrib/report_image/test.php | 14 ++++++++++++++ ext/setup/test.php | 4 ++++ 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/contrib/ban_words/test.php b/contrib/ban_words/test.php index 04a1cd32..e9f9cee8 100644 --- a/contrib/ban_words/test.php +++ b/contrib/ban_words/test.php @@ -3,7 +3,7 @@ class BanWordsTest extends ShimmieWebTestCase { function testWordBan() { $this->log_in_as_admin(); $this->get_page("setup"); - $this->set_field("_config_banned_words", "viagra\nporn\n/http:.*\.cn\//"); + $this->set_field("_config_banned_words", "viagra\nporn\n\n/http:.*\.cn\//"); $this->click("Save Settings"); $this->log_out(); @@ -21,7 +21,7 @@ class BanWordsTest extends ShimmieWebTestCase { $this->assert_title("Comment Blocked"); $this->get_page("post/view/$image_id"); - $this->set_field('comment', "kittens\n\n\n\nand viagra!"); + $this->set_field('comment', "kittens and viagra!"); $this->click("Post Comment"); $this->assert_title("Comment Blocked"); diff --git a/contrib/handle_ico/test.php b/contrib/handle_ico/test.php index 9676c0d5..41aa190c 100644 --- a/contrib/handle_ico/test.php +++ b/contrib/handle_ico/test.php @@ -6,6 +6,8 @@ class IcoHandlerTest extends ShimmieWebTestCase { $this->assert_response(302); $this->log_out(); + $raw = $this->get_page("get_ico/$image_id"); // test for no crash + $this->log_in_as_admin(); $this->delete_image($image_id); $this->log_out(); diff --git a/contrib/handle_svg/test.php b/contrib/handle_svg/test.php index e825f1f1..934d6ef6 100644 --- a/contrib/handle_svg/test.php +++ b/contrib/handle_svg/test.php @@ -17,10 +17,13 @@ class SVGHandlerTest extends ShimmieWebTestCase { '); $this->log_in_as_user(); - $image_id = $this->post_image("favicon.ico", "shimmie favicon"); + $image_id = $this->post_image("test.svg", "something"); $this->assert_response(302); $this->log_out(); + $raw = $this->get_page("get_svg/$image_id"); + $this->assertTrue(strpos($raw, "www.w3.org") > 0); + $this->log_in_as_admin(); $this->delete_image($image_id); $this->log_out(); diff --git a/contrib/ipban/test.php b/contrib/ipban/test.php index 966cb0d9..e331721b 100644 --- a/contrib/ipban/test.php +++ b/contrib/ipban/test.php @@ -18,6 +18,8 @@ class IPBanTest extends SCoreWebTestCase { $this->click("Remove"); // FIXME: remove which ban? :S $this->assert_no_text("42.42.42.42"); + $this->get_page('ip_ban/list?all=on'); // just test it doesn't crash for now + $this->log_out(); # FIXME: test that the IP is actually banned diff --git a/contrib/report_image/test.php b/contrib/report_image/test.php index 8f7ffb35..cb1339db 100644 --- a/contrib/report_image/test.php +++ b/contrib/report_image/test.php @@ -9,9 +9,23 @@ class ReportImageTest extends ShimmieWebTestCase { $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"); $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"); + $this->get_page("image_report/list"); + $this->assert_title("Reported Images"); + $this->assert_text("report details"); + $this->assert_text("$image_id"); + + $this->get_page("image_report/list"); $this->click("Remove Report"); $this->assert_title("Reported Images"); $this->assert_no_text("report details"); diff --git a/ext/setup/test.php b/ext/setup/test.php index fcf69889..bbdc8b25 100644 --- a/ext/setup/test.php +++ b/ext/setup/test.php @@ -15,6 +15,10 @@ class SetupTest extends SCoreWebTestCase { $this->get_page('setup'); $this->assert_title("Shimmie Setup"); $this->assert_text("General"); + + $this->get_page('setup/advanced'); + $this->assert_title("Shimmie Setup"); + $this->assert_text("thumb_quality"); $this->log_out(); } }