summaryrefslogtreecommitdiffstats
path: root/tests/pie_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pie_test.php')
-rw-r--r--tests/pie_test.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/pie_test.php b/tests/pie_test.php
index bd276a7..b0ce0a9 100644
--- a/tests/pie_test.php
+++ b/tests/pie_test.php
@@ -394,12 +394,12 @@ class ezcGraphPieChartTest extends ezcGraphTestCase
$chart->render( 400, 200 );
}
- public function testInavlidValues()
+ public function testInvalidValues()
{
try
{
$chart = new ezcGraphPieChart();
- $chart->data['Skien'] = new ezcGraphArrayDataSet( array() );
+ $chart->data['Skien'] = new ezcGraphArrayDataSet( array( 3, -1, 2 ) );
$chart->render( 500, 200 );
}
catch ( ezcGraphInvalidDataException $e )
@@ -410,12 +410,12 @@ class ezcGraphPieChartTest extends ezcGraphTestCase
$this->fail( 'Expected ezcGraphInvalidDataException.' );
}
- public function testInvalidValues()
+ public function testInvalidValueSum()
{
try
{
$chart = new ezcGraphPieChart();
- $chart->data['Skien'] = new ezcGraphArrayDataSet( array() );
+ $chart->data['Skien'] = new ezcGraphArrayDataSet( array( 0, 0 ) );
$chart->render( 500, 200 );
}
catch ( ezcGraphInvalidDataException $e )
@@ -479,6 +479,22 @@ class ezcGraphPieChartTest extends ezcGraphTestCase
);
}
+ public function testRenderPieChartWithZeroValues()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->data['Skien'] = new ezcGraphArrayDataSet( array( 'Norwegian' => 10, 'Dutch' => 3, 'German' => 2, 'French' => 2, 'Hindi' => 1, 'Taiwanese' => 0, 'Brazilian' => 1, 'Venezuelan' => 0, 'Japanese' => 1, 'Czech' => 0, 'Hungarian' => 1, 'Romanian' => 1 ) );
+ $chart->data['Skien']->highlight['Norwegian'] = true;
+
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
public function testRenderPieChartWithLotsOfLabels()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
OpenPOWER on IntegriCloud