summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-05-24 12:29:24 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-05-24 12:29:24 +0000
commitaa49d9ec7aaa79cc42043224386ffc30bf7c7b0f (patch)
treefd09d73e08ca90ee14e46a76a78095cffeaa0e19 /tests
parent4029d5db40e0cc0c59647d1be98ead6602800d9a (diff)
downloadzetacomponents-graph-aa49d9ec7aaa79cc42043224386ffc30bf7c7b0f.zip
zetacomponents-graph-aa49d9ec7aaa79cc42043224386ffc30bf7c7b0f.tar.gz
- Fixed issue #10842: Pie charts fatal error with datasets with value sum <= 0
Diffstat (limited to 'tests')
-rw-r--r--tests/pie_test.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/pie_test.php b/tests/pie_test.php
index f1debe4..5ddf66a 100644
--- a/tests/pie_test.php
+++ b/tests/pie_test.php
@@ -394,6 +394,54 @@ class ezcGraphPieChartTest extends ezcGraphTestCase
$chart->render( 400, 200 );
}
+ public function testInavlidValues()
+ {
+ try
+ {
+ $chart = new ezcGraphPieChart();
+ $chart->data['Skien'] = new ezcGraphArrayDataSet( array() );
+ $chart->render( 500, 200 );
+ }
+ catch ( ezcGraphInvalidDataException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'Expected ezcGraphInvalidDataException.' );
+ }
+
+ public function testInvalidValues()
+ {
+ try
+ {
+ $chart = new ezcGraphPieChart();
+ $chart->data['Skien'] = new ezcGraphArrayDataSet( array() );
+ $chart->render( 500, 200 );
+ }
+ catch ( ezcGraphInvalidDataException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'Expected ezcGraphInvalidDataException.' );
+ }
+
+ public function testEmptyDataSet()
+ {
+ try
+ {
+ $chart = new ezcGraphPieChart();
+ $chart->data['Skien'] = new ezcGraphArrayDataSet( array() );
+ $chart->render( 500, 200 );
+ }
+ catch ( ezcGraphInvalidDataException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'Expected ezcGraphInvalidDataException.' );
+ }
+
public function testRenderSmallPieChart()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
OpenPOWER on IntegriCloud