diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-11-21 10:14:22 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-11-21 10:14:22 +0000 |
commit | bb58310390495567c0b94a73d96b37cec4ff9157 (patch) | |
tree | 546ed6d2b8981106c4951ff65925db2540ae1c1b | |
parent | 4ebe2df21e475d124d594c458c63ddb2b29392ec (diff) | |
download | zetacomponents-graph-bb58310390495567c0b94a73d96b37cec4ff9157.zip zetacomponents-graph-bb58310390495567c0b94a73d96b37cec4ff9157.tar.gz |
- Added test for drawing two lines with different line width
-rw-r--r-- | tests/data/compare/ezcGraphGdDriverTest_testDrawLineWithDifferentWidths.png | bin | 0 -> 615 bytes | |||
-rw-r--r-- | tests/driver_gd_test.php | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/data/compare/ezcGraphGdDriverTest_testDrawLineWithDifferentWidths.png b/tests/data/compare/ezcGraphGdDriverTest_testDrawLineWithDifferentWidths.png Binary files differnew file mode 100644 index 0000000..323c8c2 --- /dev/null +++ b/tests/data/compare/ezcGraphGdDriverTest_testDrawLineWithDifferentWidths.png diff --git a/tests/driver_gd_test.php b/tests/driver_gd_test.php index 904b30a..eb44084 100644 --- a/tests/driver_gd_test.php +++ b/tests/driver_gd_test.php @@ -146,6 +146,38 @@ class ezcGraphGdDriverTest extends ezcTestImageCase ); } + public function testDrawLineWithDifferentWidths() + { + $filename = $this->tempDir . __FUNCTION__ . '.png'; + + $this->driver->drawLine( + new ezcGraphCoordinate( 12, 45 ), + new ezcGraphCoordinate( 134, 12 ), + ezcGraphColor::fromHex( '#3465A4' ), + 3 + ); + + $this->driver->drawLine( + new ezcGraphCoordinate( 12, 35 ), + new ezcGraphCoordinate( 134, 2 ), + ezcGraphColor::fromHex( '#3465A4' ) + ); + + $this->driver->render( $filename ); + + $this->assertTrue( + file_exists( $filename ), + 'No image was generated.' + ); + + $this->assertImageSimilar( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', + 'Image does not look as expected.', + 2000 + ); + } + public function testDrawPolygonThreePointsFilled() { $filename = $this->tempDir . __FUNCTION__ . '.png'; |