diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2008-06-18 09:48:07 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2008-06-18 09:48:07 +0000 |
commit | 56e1ea6d93e5a9327b1d14890e61c3d210cd2381 (patch) | |
tree | bcfd093ae07b0b3ce1c14a17dbe5ff1e2958bece /tests/renderer_2d_test.php | |
parent | 3f1e0ff648e5f70b90d2c2b0fbdb26ea6eafde1f (diff) | |
download | zetacomponents-graph-56e1ea6d93e5a9327b1d14890e61c3d210cd2381.zip zetacomponents-graph-56e1ea6d93e5a9327b1d14890e61c3d210cd2381.tar.gz |
- Implemented feature #13103: Different axes end styles
Diffstat (limited to 'tests/renderer_2d_test.php')
-rw-r--r-- | tests/renderer_2d_test.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php index 16d8508..53015f0 100644 --- a/tests/renderer_2d_test.php +++ b/tests/renderer_2d_test.php @@ -2133,6 +2133,50 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase ); } + public function testNoArrowHead() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $graph = new ezcGraphLineChart(); + $graph->palette = new ezcGraphPaletteBlack(); + $graph->legend->position = ezcGraph::BOTTOM; + + $graph->data['sample'] = new ezcGraphArrayDataSet( + array( 1, 4, 6, 8, 2 ) + ); + + $graph->renderer->options->axisEndStyle = ezcGraph::NO_SYMBOL; + + $graph->render( 560, 250, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testCircleArrowHead() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $graph = new ezcGraphLineChart(); + $graph->palette = new ezcGraphPaletteBlack(); + $graph->legend->position = ezcGraph::BOTTOM; + + $graph->data['sample'] = new ezcGraphArrayDataSet( + array( 1, 4, 6, 8, 2 ) + ); + + $graph->renderer->options->axisEndStyle = ezcGraph::CIRCLE; + + $graph->render( 560, 250, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + public function testRendererOptionsPropertyMaxLabelHeight() { $options = new ezcGraphRendererOptions(); @@ -2822,6 +2866,32 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase $this->fail( 'Expected ezcGraphUnknownColorDefinitionException.' ); } + public function testRendererOptionsPropertyAxisEndStyle() + { + $options = new ezcGraphRenderer2dOptions(); + + $this->assertEquals( + ezcGraph::ARROW, + $options->axisEndStyle, + 'Wrong default value for property axisEndStyle in class ezcGraphRenderer2dOptions' + ); + + $options->axisEndStyle = ezcGraph::NO_SYMBOL; + $this->assertSame( + ezcGraph::NO_SYMBOL, + $options->axisEndStyle, + 'Setting property value did not work for property axisEndStyle in class ezcGraphRenderer2dOptions' + ); + + try + { + $options->axisEndStyle = false; + $this->fail( 'Expected ezcBaseValueException.' ); + } + catch ( ezcBaseValueException $e ) + { /* Expected */ } + } + public function testChartOptionsPropertyWidth() { $options = new ezcGraphRenderer2dOptions(); |