diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-01-03 12:48:08 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-01-03 12:48:08 +0000 |
commit | 0024eea585da209c8dd6e286f634d3d41d6034a3 (patch) | |
tree | 3b60b92f31defa94473846984fd11086452bc724 /tests | |
parent | 7090a42cd106646837dde004fd8e67810c003329 (diff) | |
download | zetacomponents-graph-0024eea585da209c8dd6e286f634d3d41d6034a3.zip zetacomponents-graph-0024eea585da209c8dd6e286f634d3d41d6034a3.tar.gz |
- Fixed issue #9916: ArrayDataSet can handle Iterator was not documented
- Added and test additional typecheck
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dataset_test.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/dataset_test.php b/tests/dataset_test.php index 143a31c..850e3ab 100644 --- a/tests/dataset_test.php +++ b/tests/dataset_test.php @@ -255,16 +255,36 @@ class ezcGraphDataSetTest extends ezcTestCase ); } - public function testDataSetSetSingleData() + public function testIteratorToDataSet() { $chart = new ezcGraphPieChart(); - $chart->data['income'] = new ezcGraphArrayDataSet( array( 2000 => 2345.2, 2456.3, 2567.4 ) ); + $chart->data['income'] = new ezcGraphArrayDataSet( new ArrayIterator( array( 2000 => 2345.2, 2456.3, 2567.4 ) ) ); $chart->data['income'][2005] = 234.21; $this->assertSame( 234.21, $chart->data['income'][2005] ); + + $this->assertSame( + 2456.3, + $chart->data['income'][2001] + ); + } + + public function testDataSetInvalidDataSource() + { + $chart = new ezcGraphPieChart(); + try + { + $chart->data['income'] = new ezcGraphArrayDataSet( $chart ); + } + catch ( ezcGraphInvalidArrayDataSourceException $e ) + { + return true; + } + + $this->fail( 'Expected ezcGraphInvalidArrayDataSourceException.' ); } } ?> |