summaryrefslogtreecommitdiffstats
path: root/tests
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
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')
-rw-r--r--tests/chart_test.php30
-rw-r--r--tests/data/compare/ezcGraphChartTest_testReRenderChart.svg2
2 files changed, 32 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';
diff --git a/tests/data/compare/ezcGraphChartTest_testReRenderChart.svg b/tests/data/compare/ezcGraphChartTest_testReRenderChart.svg
new file mode 100644
index 0000000..06a5973
--- /dev/null
+++ b/tests/data/compare/ezcGraphChartTest_testReRenderChart.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200" version="1.0" id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L 400.0000,0.0000 L 400.0000,200.0000 L 0.0000,200.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_1"/><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L 80.0000,0.0000 L 80.0000,200.0000 L 0.0000,200.0000 z " style="fill: #000000; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_2"/><path d=" M 2.0000,16.0000 L 2.0000,2.0000 L 16.0000,2.0000 L 16.0000,16.0000 L 2.0000,16.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_3"/><path d=" M 80.0000,180.0000 L 400.0000,180.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_5"/><path d=" M 392.0000,176.0000 L 400.0000,180.0000 L 392.0000,184.0000 L 392.0000,176.0000 z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_6"/><path d=" M 112.0000,200.0000 L 112.0000,0.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_7"/><path d=" M 109.5000,5.0000 L 112.0000,0.0000 L 114.5000,5.0000 L 109.5000,5.0000 z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_8"/><path d=" M 240.0000,20.0000 L 240.0000,180.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_9"/><path d=" M 240.0000,177.0000 L 240.0000,180.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_10"/><path d=" M 368.0000,20.0000 L 368.0000,180.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_12"/><path d=" M 368.0000,177.0000 L 368.0000,180.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_13"/><path d=" M 112.0000,172.0000 L 368.0000,172.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_16"/><path d=" M 112.0000,172.0000 L 113.0000,172.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_17"/><path d=" M 112.0000,164.0000 L 368.0000,164.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_18"/><path d=" M 112.0000,164.0000 L 113.0000,164.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_19"/><path d=" M 112.0000,156.0000 L 368.0000,156.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_20"/><path d=" M 112.0000,156.0000 L 113.0000,156.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_21"/><path d=" M 112.0000,148.0000 L 368.0000,148.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_22"/><path d=" M 112.0000,148.0000 L 115.0000,148.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_23"/><path d=" M 112.0000,140.0000 L 368.0000,140.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_25"/><path d=" M 112.0000,140.0000 L 113.0000,140.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_26"/><path d=" M 112.0000,132.0000 L 368.0000,132.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><path d=" M 112.0000,132.0000 L 113.0000,132.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_28"/><path d=" M 112.0000,124.0000 L 368.0000,124.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_29"/><path d=" M 112.0000,124.0000 L 113.0000,124.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_30"/><path d=" M 112.0000,116.0000 L 368.0000,116.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><path d=" M 112.0000,116.0000 L 115.0000,116.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_32"/><path d=" M 112.0000,108.0000 L 368.0000,108.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_34"/><path d=" M 112.0000,108.0000 L 113.0000,108.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><path d=" M 112.0000,100.0000 L 368.0000,100.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_36"/><path d=" M 112.0000,100.0000 L 113.0000,100.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_37"/><path d=" M 112.0000,92.0000 L 368.0000,92.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_38"/><path d=" M 112.0000,92.0000 L 113.0000,92.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_39"/><path d=" M 112.0000,84.0000 L 368.0000,84.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_40"/><path d=" M 112.0000,84.0000 L 115.0000,84.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_41"/><path d=" M 112.0000,76.0000 L 368.0000,76.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_43"/><path d=" M 112.0000,76.0000 L 113.0000,76.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_44"/><path d=" M 112.0000,68.0000 L 368.0000,68.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_45"/><path d=" M 112.0000,68.0000 L 113.0000,68.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_46"/><path d=" M 112.0000,60.0000 L 368.0000,60.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_47"/><path d=" M 112.0000,60.0000 L 113.0000,60.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_48"/><path d=" M 112.0000,52.0000 L 368.0000,52.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_49"/><path d=" M 112.0000,52.0000 L 115.0000,52.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_50"/><path d=" M 112.0000,44.0000 L 368.0000,44.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_52"/><path d=" M 112.0000,44.0000 L 113.0000,44.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_53"/><path d=" M 112.0000,36.0000 L 368.0000,36.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_54"/><path d=" M 112.0000,36.0000 L 113.0000,36.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_55"/><path d=" M 112.0000,28.0000 L 368.0000,28.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_56"/><path d=" M 112.0000,28.0000 L 113.0000,28.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_57"/><path d=" M 112.0000,20.0000 L 368.0000,20.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_58"/><path d=" M 112.0000,20.0000 L 115.0000,20.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_59"/><path d=" M 112.0000,164.0000 L 112.0000,164.0000" style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_61"/><path d=" M 112.0000,164.0000 L 240.0000,106.4000" style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_62"/><path d=" M 240.0000,106.4000 L 368.0000,45.6000" style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_63"/><g id="ezcGraphTextBox_4"><path d=" M 16.5000,17.0000 L 16.5000,1.5000 L 47.6800,1.5000 L 47.6800,17.0000 L 16.5000,17.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_64"/><text id="ezcGraphTextBox_4_text" x="17.0000" text-length="29.6800px" y="13.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">test</text></g><g id="ezcGraphTextBox_11"><path d=" M 235.7800,195.0000 L 235.7800,181.5000 L 244.7200,181.5000 L 244.7200,195.0000 L 235.7800,195.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_65"/><text id="ezcGraphTextBox_11_text" x="236.2800" text-length="7.4400px" y="192.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">1</text></g><g id="ezcGraphTextBox_14"><path d=" M 363.7800,195.0000 L 363.7800,181.5000 L 372.7200,181.5000 L 372.7200,195.0000 L 363.7800,195.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_66"/><text id="ezcGraphTextBox_14_text" x="364.2800" text-length="7.4400px" y="192.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">2</text></g><g id="ezcGraphTextBox_15"><path d=" M 102.0600,179.0000 L 102.0600,165.5000 L 111.0000,165.5000 L 111.0000,179.0000 L 102.0600,179.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_67"/><text id="ezcGraphTextBox_15_text" x="102.5600" text-length="7.4400px" y="176.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">0</text></g><g id="ezcGraphTextBox_24"><path d=" M 94.6200,147.0000 L 94.6200,133.5000 L 111.0000,133.5000 L 111.0000,147.0000 L 94.6200,147.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_68"/><text id="ezcGraphTextBox_24_text" x="95.1200" text-length="14.8800px" y="144.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">10</text></g><g id="ezcGraphTextBox_33"><path d=" M 94.6200,115.0000 L 94.6200,101.5000 L 111.0000,101.5000 L 111.0000,115.0000 L 94.6200,115.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_69"/><text id="ezcGraphTextBox_33_text" x="95.1200" text-length="14.8800px" y="112.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">20</text></g><g id="ezcGraphTextBox_42"><path d=" M 94.6200,83.0000 L 94.6200,69.5000 L 111.0000,69.5000 L 111.0000,83.0000 L 94.6200,83.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_70"/><text id="ezcGraphTextBox_42_text" x="95.1200" text-length="14.8800px" y="80.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">30</text></g><g id="ezcGraphTextBox_51"><path d=" M 94.6200,51.0000 L 94.6200,37.5000 L 111.0000,37.5000 L 111.0000,51.0000 L 94.6200,51.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_71"/><text id="ezcGraphTextBox_51_text" x="95.1200" text-length="14.8800px" y="48.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">40</text></g><g id="ezcGraphTextBox_60"><path d=" M 94.6200,35.0000 L 94.6200,21.5000 L 111.0000,21.5000 L 111.0000,35.0000 L 94.6200,35.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_72"/><text id="ezcGraphTextBox_60_text" x="95.1200" text-length="14.8800px" y="32.2000" style="font-size: 12px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">50</text></g></g></svg>
OpenPOWER on IntegriCloud