summaryrefslogtreecommitdiffstats
path: root/tests/chart_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2008-05-31 07:08:06 +0000
committerKore Nordmann <github@kore-nordmann.de>2008-05-31 07:08:06 +0000
commitd3c847e64379eec8e4987e5448ad8490e592f6d9 (patch)
tree02660e1d6a2644631a88259251dc1543da0e17a1 /tests/chart_test.php
parent82208f0a38c7c4f5825bac9fc4268bdba03db5a9 (diff)
downloadzetacomponents-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.php30
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';
OpenPOWER on IntegriCloud