summaryrefslogtreecommitdiffstats
path: root/tests/image_map_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-11-13 10:42:28 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-11-13 10:42:28 +0000
commited56f56cb053a9ca813d35e86fe9f70ce146da4a (patch)
tree733094f2a5278ca2f706deb7215fd734c9c43f8c /tests/image_map_test.php
parent5183c24081553efe57962354879f6510084e2418 (diff)
downloadzetacomponents-graph-ed56f56cb053a9ca813d35e86fe9f70ce146da4a.zip
zetacomponents-graph-ed56f56cb053a9ca813d35e86fe9f70ce146da4a.tar.gz
- Fixed: Bug #9403 (Element references do not work with Gleam in SVG)
Diffstat (limited to 'tests/image_map_test.php')
-rw-r--r--tests/image_map_test.php73
1 files changed, 71 insertions, 2 deletions
diff --git a/tests/image_map_test.php b/tests/image_map_test.php
index 91a1935..437613c 100644
--- a/tests/image_map_test.php
+++ b/tests/image_map_test.php
@@ -214,7 +214,6 @@ class ezcGraphImageMapTest extends ezcTestCase
$chart->palette = new ezcGraphPaletteBlack();
$chart->renderer = new ezcGraphRenderer3d();
- $chart = new ezcGraphPieChart();
$chart->data['sample'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 4375,
'IE' => 345,
@@ -231,8 +230,78 @@ class ezcGraphImageMapTest extends ezcTestCase
$this->assertSame( 1, count( $reference['data'] ), 'One dataset expected.' );
$this->assertSame( 5, count( $reference['data']['sample'] ), '5 datapoints expected.' );
$this->assertSame( 2, count( $reference['data']['sample']['Mozilla'] ), '2 elements for datapoint expexted' );
+ $this->assertSame( 'ezcGraphCircleSector_40', $reference['data']['sample']['Mozilla'][0], 'ezcGraphCircleSector expected.' );
+ $this->assertSame( 'ezcGraphTextBox_61', $reference['data']['sample']['Mozilla'][1], 'ezcGraphTextBox expected.' );
+
+ // Check legend references
+ $this->assertSame( 5, count( $reference['legend'] ), '5 legend items expected.' );
+ $this->assertSame( 2, count( $reference['legend']['IE'] ), '2 elements for legend item expected.' );
+ $this->assertSame( 'ezcGraphCircle_6', $reference['legend']['IE']['symbol'], 'ezcGraphCircle expected as legend symbol.' );
+ $this->assertSame( 'ezcGraphTextBox_7', $reference['legend']['IE']['text'], 'ezcGraphTextBox expected for legend text.' );
+ }
+
+ public function testReturnFrom2dSvgPieChartWithGleam()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->renderer->options->pieChartGleam = .5;
+
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->render( 500, 200, $filename );
+
+ $reference = $chart->renderer->getElementReferences();
+
+ // Check data references
+ $this->assertSame( 1, count( $reference['data'] ), 'One dataset expected.' );
+ $this->assertSame( 5, count( $reference['data']['sample'] ), '5 datapoints expected.' );
+ $this->assertSame( 4, count( $reference['data']['sample']['Mozilla'] ), '2 elements for datapoint expexted' );
$this->assertSame( 'ezcGraphCircleSector_13', $reference['data']['sample']['Mozilla'][0], 'ezcGraphCircleSector expected.' );
- $this->assertSame( 'ezcGraphTextBox_34', $reference['data']['sample']['Mozilla'][1], 'ezcGraphTextBox expected.' );
+ $this->assertSame( 'ezcGraphCircleSector_15', $reference['data']['sample']['Mozilla'][1], 'ezcGraphCircleSector expected.' );
+ $this->assertSame( 'ezcGraphCircleSector_16', $reference['data']['sample']['Mozilla'][2], 'ezcGraphCircleSector expected.' );
+ $this->assertSame( 'ezcGraphTextBox_44', $reference['data']['sample']['Mozilla'][3], 'ezcGraphTextBox expected.' );
+
+ // Check legend references
+ $this->assertSame( 5, count( $reference['legend'] ), '5 legend items expected.' );
+ $this->assertSame( 2, count( $reference['legend']['IE'] ), '2 elements for legend item expected.' );
+ $this->assertSame( 'ezcGraphPolygon_5', $reference['legend']['IE']['symbol'], 'ezcGraphPolygon expected as legend symbol.' );
+ $this->assertSame( 'ezcGraphTextBox_6', $reference['legend']['IE']['text'], 'ezcGraphTextBox expected for legend text.' );
+ }
+
+ public function testReturnFrom3dSvgPieChartWithGleam()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->renderer = new ezcGraphRenderer3d();
+ $chart->renderer->options->pieChartGleam = .5;
+
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->render( 500, 200, $filename );
+
+ $reference = $chart->renderer->getElementReferences();
+
+ // Check data references
+ $this->assertSame( 1, count( $reference['data'] ), 'One dataset expected.' );
+ $this->assertSame( 5, count( $reference['data']['sample'] ), '5 datapoints expected.' );
+ $this->assertSame( 3, count( $reference['data']['sample']['Mozilla'] ), '2 elements for datapoint expexted' );
+ $this->assertSame( 'ezcGraphCircleSector_39', $reference['data']['sample']['Mozilla'][0], 'ezcGraphCircleSector expected.' );
+ $this->assertSame( 'ezcGraphCircleSector_40', $reference['data']['sample']['Mozilla'][1], 'ezcGraphCircleSector expected.' );
+ $this->assertSame( 'ezcGraphTextBox_71', $reference['data']['sample']['Mozilla'][2], 'ezcGraphTextBox expected.' );
// Check legend references
$this->assertSame( 5, count( $reference['legend'] ), '5 legend items expected.' );
OpenPOWER on IntegriCloud