summaryrefslogtreecommitdiffstats
path: root/tests/driver_svg_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-11-30 11:11:42 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-11-30 11:11:42 +0000
commitf7ffcb314f4cbb09e3ae16653a944f11201dd1d1 (patch)
treeef5c140bb6448c1a595fc8b79c0fbc4812eab49b /tests/driver_svg_test.php
parent52e8f6cd727f0fd0bbd735d2c72fe7cffff8f565 (diff)
downloadzetacomponents-graph-f7ffcb314f4cbb09e3ae16653a944f11201dd1d1.zip
zetacomponents-graph-f7ffcb314f4cbb09e3ae16653a944f11201dd1d1.tar.gz
- Implemented #9647 (Add render to output method)
Diffstat (limited to 'tests/driver_svg_test.php')
-rw-r--r--tests/driver_svg_test.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/driver_svg_test.php b/tests/driver_svg_test.php
index eeb8dcd..88da61d 100644
--- a/tests/driver_svg_test.php
+++ b/tests/driver_svg_test.php
@@ -81,6 +81,33 @@ class ezcGraphSvgDriverTest extends ezcTestCase
}
}
+ public function testRenderToOutput()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $this->driver->drawLine(
+ new ezcGraphCoordinate( 12, 45 ),
+ new ezcGraphCoordinate( 134, 12 ),
+ ezcGraphColor::fromHex( '#3465A4' )
+ );
+
+ $this->assertEquals(
+ $this->driver->getMimeType(),
+ 'image/svg+xml',
+ 'Wrong mime type returned.'
+ );
+
+ ob_start();
+ // Suppress header already sent warning
+ @$this->driver->renderToOutput();
+ file_put_contents( $filename, ob_get_clean() );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
public function testDrawLine()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
OpenPOWER on IntegriCloud