summaryrefslogtreecommitdiffstats
path: root/tests/chart_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-05-09 11:38:32 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-05-09 11:38:32 +0000
commit0f060a5d867310cb71a8fc82cd3bb982fb93fba6 (patch)
tree98714baae34f7bea6efc9699c8b630f368ca7708 /tests/chart_test.php
parent3cb117beb5bd17c6f8082717eb40467f3ddf79c8 (diff)
downloadzetacomponents-graph-0f060a5d867310cb71a8fc82cd3bb982fb93fba6.zip
zetacomponents-graph-0f060a5d867310cb71a8fc82cd3bb982fb93fba6.tar.gz
- Added tests for ezcGraphChart
Diffstat (limited to 'tests/chart_test.php')
-rw-r--r--tests/chart_test.php105
1 files changed, 99 insertions, 6 deletions
diff --git a/tests/chart_test.php b/tests/chart_test.php
index d2e31a5..5d466fe 100644
--- a/tests/chart_test.php
+++ b/tests/chart_test.php
@@ -1,6 +1,6 @@
<?php
/**
- * ezcChartTest
+ * ezcGraphChartTest
*
* @package Graph
* @version //autogen//
@@ -15,7 +15,7 @@
* @package ImageAnalysis
* @subpackage Tests
*/
-class ezcChartTest extends ezcTestCase
+class ezcGraphChartTest extends ezcTestCase
{
protected $testFiles = array(
'jpeg' => 'jpeg.jpg',
@@ -27,7 +27,7 @@ class ezcChartTest extends ezcTestCase
public static function suite()
{
- return new ezcTestSuite( "ezcChartTest" );
+ return new ezcTestSuite( "ezcGraphChartTest" );
}
/**
@@ -96,12 +96,12 @@ class ezcChartTest extends ezcTestCase
$this->fail( 'Expected ezcGraphInvalidImageFileException' );
}
- public function testSetOptionsInvalidBackgroundImage()
+ public function testSetOptionsNonexistantBackgroundImage()
{
try
{
$pieChart = ezcGraph::create( 'Pie' );
- $pieChart->options->backgroundImage = $this->basePath . $this->testFiles['nonexisting'];
+ $pieChart->options->backgroundImage = $this->basePath . $this->testFiles['nonexistant'];
}
catch ( ezcGraphFileNotFoundException $e )
{
@@ -115,6 +115,99 @@ class ezcChartTest extends ezcTestCase
$this->fail( 'Expected ezcGraphFileNotFoundException' );
}
- public function test
+ public function testSetOptionsBackground()
+ {
+ try
+ {
+ $pieChart = ezcGraph::create( 'Pie' );
+ $pieChart->options->background = '#FF0000';
+ }
+ catch ( Exception $e )
+ {
+ $this->fail( $e->getMessage() );
+ }
+ }
+
+ public function testSetOptionsBorder()
+ {
+ try
+ {
+ $pieChart = ezcGraph::create( 'Pie' );
+ $pieChart->options->border = '#FF0000';
+ }
+ catch ( Exception $e )
+ {
+ $this->fail( $e->getMessage() );
+ }
+ }
+
+ public function testSetRenderer()
+ {
+ try
+ {
+ $pieChart = ezcGraph::create( 'Pie' );
+ $pieChart->renderer = new ezcGraphRenderer2D();
+ }
+ catch ( Exception $e )
+ {
+ $this->fail( $e->getMessage() );
+ }
+ }
+
+ public function testSetInvalidRenderer()
+ {
+ try
+ {
+ $pieChart = ezcGraph::create( 'Pie' );
+ $pieChart->renderer = 'invalid';
+ }
+ catch ( ezcGraphInvalidRendererException $e )
+ {
+ return true;
+ }
+ catch ( Exception $e )
+ {
+ $this->fail( $e->getMessage() );
+ }
+
+ $this->fail( 'Expected ezcGraphInvalidRendererException' );
+ }
+
+ public function testSetDriver()
+ {
+ try
+ {
+ $pieChart = ezcGraph::create( 'Pie' );
+ $pieChart->driver = new ezcGraphGDDriver();
+ }
+ catch ( Exception $e )
+ {
+ $this->fail( $e->getMessage() );
+ }
+ }
+
+ public function testSetInvalidDriver()
+ {
+ try
+ {
+ $pieChart = ezcGraph::create( 'Pie' );
+ $pieChart->driver = 'invalid';
+ }
+ catch ( ezcGraphInvalidDriverException $e )
+ {
+ return true;
+ }
+ catch ( Exception $e )
+ {
+ $this->fail( $e->getMessage() );
+ }
+
+ $this->fail( 'Expected ezcGraphInvalidDriverException' );
+ }
+
+ public function testRender()
+ {
+ $this->fail( '@TODO: Implement renderer tests.' );
+ }
}
?>
OpenPOWER on IntegriCloud