diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-05-15 13:29:35 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-05-15 13:29:35 +0000 |
commit | 87c1ed6ce0813da4eafbd26a422846ab8b2ac808 (patch) | |
tree | 0c26c5c266f3186a70bd631852f9a53eefddab78 /tests/labeled_axis_test.php | |
parent | 945b562659c64bf83f40b68f0d41d94dc1076055 (diff) | |
download | zetacomponents-graph-87c1ed6ce0813da4eafbd26a422846ab8b2ac808.zip zetacomponents-graph-87c1ed6ce0813da4eafbd26a422846ab8b2ac808.tar.gz |
- Added tests for labeled axis
Diffstat (limited to 'tests/labeled_axis_test.php')
-rw-r--r-- | tests/labeled_axis_test.php | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/tests/labeled_axis_test.php b/tests/labeled_axis_test.php new file mode 100644 index 0000000..421d639 --- /dev/null +++ b/tests/labeled_axis_test.php @@ -0,0 +1,107 @@ +<?php +/** + * ezcGraphLabeledAxisTest + * + * @package Graph + * @version //autogen// + * @subpackage Tests + * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ + +/** + * Tests for ezcGraph class. + * + * @package ImageAnalysis + * @subpackage Tests + */ +class ezcGraphLabeledAxisTest extends ezcTestCase +{ + + public static function suite() + { + return new ezcTestSuite( "ezcGraphLabeledAxisTest" ); + } + + /** + * setUp + * + * @access public + */ + public function setUp() + { + } + + /** + * tearDown + * + * @access public + */ + public function tearDown() + { + } + + public function testFactoryLabeledAxis() + { + $chart = ezcGraph::create( 'Line' ); + + $this->assertTrue( + $chart->X_axis instanceof ezcGraphChartElementLabeledAxis + ); + } + + public function testAutomaticLabelingSingle() + { + try + { + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 2000 => 20, 70, 12, 130 ); + } + catch ( Exception $e ) + { + $this->fail( $e->getMessage() ); + } + + $this->assertSame( + array( + '2000', + '2001', + '2002', + '2003', + ), + $this->getNonPublicProperty( $chart->X_axis, 'labels' ) + ); + } + + public function testAutomaticLabelingMultiple() + { + try + { + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 ); + $chart->sample2 = array( 2002 => 1270, 1170, 1610, 1370 ); + } + catch ( Exception $e ) + { + $this->fail( $e->getMessage() ); + } + + $this->assertSame( + array( + '2000', + '2001', + '2002', + '2003', + '2004', + '2005', + ), + $this->getNonPublicProperty( $chart->X_axis, 'labels' ) + ); + } + + public function testRender() + { + $this->fail( '@TODO: Implement renderer tests.' ); + } +} +?> |