diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2008-05-31 07:08:06 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2008-05-31 07:08:06 +0000 |
commit | d3c847e64379eec8e4987e5448ad8490e592f6d9 (patch) | |
tree | 02660e1d6a2644631a88259251dc1543da0e17a1 /tests/chart_test.php | |
parent | 82208f0a38c7c4f5825bac9fc4268bdba03db5a9 (diff) | |
download | zetacomponents-graph-d3c847e64379eec8e4987e5448ad8490e592f6d9.zip zetacomponents-graph-d3c847e64379eec8e4987e5448ad8490e592f6d9.tar.gz |
- Resolved #12379: Ensure one chart can be rerendered with new datasets)
Diffstat (limited to 'tests/chart_test.php')
-rw-r--r-- | tests/chart_test.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/chart_test.php b/tests/chart_test.php index 1529f98..eeed574 100644 --- a/tests/chart_test.php +++ b/tests/chart_test.php @@ -237,6 +237,36 @@ class ezcGraphChartTest extends ezcGraphTestCase ); } + public function testReRenderChart() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $barChart = new ezcGraphLineChart(); + + $barChart->data['test'] = new ezcGraphArrayDataSet( + array( 5, 23, 42 ) + ); + $color = $barChart->data['test']->color->default; + $barChart->render( 400, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + + // Render a second time with a new dataset, and expect the same result + $barChart->data['test'] = new ezcGraphArrayDataSet( + array( 5, 23, 42 ) + ); + $barChart->data['test']->color = $color; + $barChart->render( 400, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + public function testCustomChartClass() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; |