summaryrefslogtreecommitdiffstats
path: root/tests/odometer_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-11-23 12:40:39 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-11-23 12:40:39 +0000
commitaa6990d330fd354477f767adb22cc4c02b18c76e (patch)
tree8260423701712d11299a25a4bba1f6083e421f16 /tests/odometer_test.php
parent4b6f409dd6023baee2f89454e868d4286709092c (diff)
downloadzetacomponents-graph-aa6990d330fd354477f767adb22cc4c02b18c76e.zip
zetacomponents-graph-aa6990d330fd354477f767adb22cc4c02b18c76e.tar.gz
- Fixed some first issues in Graph
Diffstat (limited to 'tests/odometer_test.php')
-rw-r--r--tests/odometer_test.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/odometer_test.php b/tests/odometer_test.php
index 73cae07..27c23ae 100644
--- a/tests/odometer_test.php
+++ b/tests/odometer_test.php
@@ -221,6 +221,33 @@ class ezcGraphOdometerChartTest extends ezcGraphTestCase
$this->fail( 'Expected ezcBaseValueException.' );
}
+ public function testOdometerChartPropertyAxis()
+ {
+ $chart = new ezcGraphOdometerChart();
+
+ $this->assertTrue(
+ $chart->axis instanceof ezcGraphChartElementNumericAxis,
+ 'Wrong default value for property axis in class ezcGraphOdometerChart'
+ );
+
+ $chart->axis = new ezcGraphChartElementLabeledAxis();
+ $this->assertTrue(
+ $chart->axis instanceof ezcGraphChartElementLabeledAxis,
+ 'Setting property value did not work for property axis in class ezcGraphOdometerChart'
+ );
+
+ try
+ {
+ $chart->axis = true;
+ }
+ catch ( ezcBaseValueException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'Expected ezcBaseValueException.' );
+ }
+
public function testRenderOdometer()
{
$chart = new ezcGraphOdometerChart();
@@ -329,6 +356,24 @@ class ezcGraphOdometerChartTest extends ezcGraphTestCase
$this->fail( 'Expected ezcGraphNoDataException.' );
}
+ public function testIncompatibleRenderer()
+ {
+ $chart = new ezcGraphOdometerChart();
+ $chart->data['sampleData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 1, 'sample 5' => 120 ) );
+
+ try
+ {
+ $chart->renderer = new ezcGraphRenderer3d();
+ $chart->render( 500, 200 );
+ }
+ catch ( ezcBaseValueException $e )
+ {
+ return;
+ }
+
+ $this->fail( 'Expected ezcBaseValueException.' );
+ }
+
public function testRenderCompleteOdometer()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
OpenPOWER on IntegriCloud