diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-05-09 13:20:31 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-05-09 13:20:31 +0000 |
commit | 9cace6f3a5815b94bbbc0547087fd9640afd8cd5 (patch) | |
tree | a9be5a5982a8e5be90ecc524ed84f243ceb45e8f /tests/chart_test.php | |
parent | 0f060a5d867310cb71a8fc82cd3bb982fb93fba6 (diff) | |
download | zetacomponents-graph-9cace6f3a5815b94bbbc0547087fd9640afd8cd5.zip zetacomponents-graph-9cace6f3a5815b94bbbc0547087fd9640afd8cd5.tar.gz |
- Added more tests for ezcGraphChart
- Implemented setting renderer and driver
- Started with setting of chart options (yet incomplete)
Diffstat (limited to 'tests/chart_test.php')
-rw-r--r-- | tests/chart_test.php | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/tests/chart_test.php b/tests/chart_test.php index 5d466fe..6eefafd 100644 --- a/tests/chart_test.php +++ b/tests/chart_test.php @@ -75,6 +75,8 @@ class ezcGraphChartTest extends ezcTestCase { $this->fail( $e->getMessage() ); } + + $this->assertProtectedPropertySame( $pieChart->options, 'backgroundImage', $this->basePath . $this->testFiles['jpeg'] ); } public function testSetOptionsInvalidBackgroundImage() @@ -126,6 +128,8 @@ class ezcGraphChartTest extends ezcTestCase { $this->fail( $e->getMessage() ); } + + $this->assertProtectedPropertySame( $pieChart->options, 'background', ezcGraphColor::fromHex( 'FF0000' ) ); } public function testSetOptionsBorder() @@ -139,6 +143,42 @@ class ezcGraphChartTest extends ezcTestCase { $this->fail( $e->getMessage() ); } + + $this->assertProtectedPropertySame( $pieChart->options, 'border', ezcGraphColor::fromHex( 'FF0000' ) ); + } + + public function testSetOptionsBorderWidth() + { + try + { + $pieChart = ezcGraph::create( 'Pie' ); + $pieChart->options->borderWidth = 3; + } + catch ( Exception $e ) + { + $this->fail( $e->getMessage() ); + } + + $this->assertProtectedPropertySame( $pieChart->options, 'borderWidth', 3 ); + } + + public function testSetOptionsUnknown() + { + try + { + $pieChart = ezcGraph::create( 'Pie' ); + $pieChart->options->unknown = 'unknown'; + } + catch ( ezcBasePropertyNotFoundException $e ) + { + return true; + } + catch ( Exception $e ) + { + $this->fail( $e->getMessage() ); + } + + $this->fail( 'Expected ezcBasePropertyNotFoundException' ); } public function testSetRenderer() @@ -146,12 +186,14 @@ class ezcGraphChartTest extends ezcTestCase try { $pieChart = ezcGraph::create( 'Pie' ); - $pieChart->renderer = new ezcGraphRenderer2D(); + $renderer = $pieChart->renderer = new ezcGraphRenderer2D(); } catch ( Exception $e ) { $this->fail( $e->getMessage() ); } + + $this->assertProtectedPropertySame( $pieChart, 'renderer', $renderer ); } public function testSetInvalidRenderer() @@ -178,12 +220,14 @@ class ezcGraphChartTest extends ezcTestCase try { $pieChart = ezcGraph::create( 'Pie' ); - $pieChart->driver = new ezcGraphGDDriver(); + $driver = $pieChart->driver = new ezcGraphGDDriver(); } catch ( Exception $e ) { $this->fail( $e->getMessage() ); } + + $this->assertProtectedPropertySame( $pieChart, 'driver', $driver ); } public function testSetInvalidDriver() |