more tests
This commit is contained in:
parent
2600ef042b
commit
13dfb8861f
@ -1,10 +1,8 @@
|
||||
<?php
|
||||
class IcoHandlerTest { // extends ShimmiePHPUnitTestCase {
|
||||
class IcoHandlerTest extends ShimmiePHPUnitTestCase {
|
||||
function testIcoHander() {
|
||||
$this->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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
class SVGHandlerTest { // extends ShimmiePHPUnitTestCase {
|
||||
class SVGHandlerTest extends ShimmiePHPUnitTestCase {
|
||||
function testSVGHander() {
|
||||
$this->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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ abstract class ShimmiePHPUnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
protected function post_image($filename, $tags) {
|
||||
$dae = new DataUploadEvent($filename, array(
|
||||
"filename" => $filename,
|
||||
"extension"=>'jpg', // fixme
|
||||
"extension" => pathinfo($filename, PATHINFO_EXTENSION),
|
||||
"tags" => $tags,
|
||||
"source" => null,
|
||||
));
|
||||
|
Loading…
x
Reference in New Issue
Block a user