diff --git a/ext/handle_ico/test.php b/ext/handle_ico/test.php index 0ae08ff0..06674539 100644 --- a/ext/handle_ico/test.php +++ b/ext/handle_ico/test.php @@ -1,10 +1,8 @@ log_in_as_user(); $image_id = $this->post_image("lib/static/favicon.ico", "shimmie favicon"); - $this->assert_response(302); - $this->get_page("post/view/$image_id"); // test for no crash $this->get_page("get_ico/$image_id"); // test for no crash @@ -12,3 +10,4 @@ class IcoHandlerTest { // extends ShimmiePHPUnitTestCase { # FIXME: test that it gets displayed properly } } + diff --git a/ext/handle_svg/test.php b/ext/handle_svg/test.php index 3ec99b97..41501b1c 100644 --- a/ext/handle_svg/test.php +++ b/ext/handle_svg/test.php @@ -1,14 +1,14 @@ log_in_as_user(); $image_id = $this->post_image("tests/test.svg", "something"); - $this->assert_response(302); - - $raw = $this->get_page("get_svg/$image_id"); - $this->assertTrue(strpos($raw, "www.w3.org") > 0); + $this->get_page("post/view/$image_id"); // test for no crash + $this->get_page("get_svg/$image_id"); // test for no crash + $this->assert_content("www.w3.org"); # FIXME: test that the thumb works # FIXME: test that it gets displayed properly } } + diff --git a/ext/regen_thumb/test.php b/ext/regen_thumb/test.php index 4191fcd5..3424d76a 100644 --- a/ext/regen_thumb/test.php +++ b/ext/regen_thumb/test.php @@ -4,10 +4,10 @@ class RegenThumbTest { $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->click("Regenerate"); + + $_POST['image_id'] = $image_id; + $this->get_page("regen_thumb"); $this->assert_title("Thumbnail Regenerated"); - $this->delete_image($image_id); - $this->log_out(); # FIXME: test that the thumb's modified time has been updated } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index bd9ddf1c..6902f67a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -109,10 +109,10 @@ abstract class ShimmiePHPUnitTestCase extends PHPUnit_Framework_TestCase { */ protected function post_image($filename, $tags) { $dae = new DataUploadEvent($filename, array( - "filename"=>$filename, - "extension"=>'jpg', // fixme - "tags"=>$tags, - "source"=>null, + "filename" => $filename, + "extension" => pathinfo($filename, PATHINFO_EXTENSION), + "tags" => $tags, + "source" => null, )); send_event($dae); $this->images[] = $dae->image_id;