diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-05-24 12:29:24 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-05-24 12:29:24 +0000 |
commit | aa49d9ec7aaa79cc42043224386ffc30bf7c7b0f (patch) | |
tree | fd09d73e08ca90ee14e46a76a78095cffeaa0e19 /tests | |
parent | 4029d5db40e0cc0c59647d1be98ead6602800d9a (diff) | |
download | zetacomponents-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.php | 48 |
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'; |