This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/handle_svg/test.php

38 lines
973 B
PHP
Raw Normal View History

2009-07-16 19:21:49 +00:00
<?php
class SVGHandlerTest extends ShimmieWebTestCase {
function testSVGHander() {
file_put_contents("test.svg", '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
width="128"
height="128"
id="svg2"
version="1.0">
<g id="layer1">
<path
style="fill:#0000ff;stroke:#213847;stroke-opacity:1"
id="path2383"
d="M 120.07832,64.983688 A 55.573441,53.092484 0 1 1 8.9314423,64.983688 A 55.573441,53.092484 0 1 1 120.07832,64.983688 z" />
</g>
</svg>');
$this->log_in_as_user();
2009-09-27 14:48:38 +00:00
$image_id = $this->post_image("test.svg", "something");
2009-08-19 00:28:48 +00:00
$this->assert_response(302);
2009-07-16 19:21:49 +00:00
$this->log_out();
2009-09-27 14:48:38 +00:00
$raw = $this->get_page("get_svg/$image_id");
$this->assertTrue(strpos($raw, "www.w3.org") > 0);
2009-07-16 19:21:49 +00:00
$this->log_in_as_admin();
$this->delete_image($image_id);
$this->log_out();
unlink("test.svg");
2009-07-20 05:51:36 +00:00
# FIXME: test that the thumb works
# FIXME: test that it gets displayed properly
2009-07-16 19:21:49 +00:00
}
}