summaryrefslogtreecommitdiffstats
path: root/tests/renderer_3d_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/renderer_3d_test.php')
-rw-r--r--tests/renderer_3d_test.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php
index 8b0074b..7491169 100644
--- a/tests/renderer_3d_test.php
+++ b/tests/renderer_3d_test.php
@@ -46,7 +46,10 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase
*/
public function tearDown()
{
- $this->removeTempDir();
+ if( !$this->hasFailed() )
+ {
+ $this->removeTempDir();
+ }
}
public function testRenderBackgroundImage()
@@ -559,6 +562,33 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase
);
}
+ public function testRenderBarChart()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.png';
+
+ $chart = new ezcGraphLineChart();
+ $chart->palette = new ezcGraphPaletteBlack();
+
+ $chart->data['Line 0'] = new ezcGraphArrayDataSet( array( 'sample 1' => 432, 'sample 2' => 43, 'sample 3' => 65, 'sample 4' => 97, 'sample 5' => 154) );
+ $chart->data['Line 0']->displayType = ezcGraph::BAR;
+ $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
+ $chart->data['Line 1']->displayType = ezcGraph::BAR;
+
+ $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer();
+
+ $chart->driver = new ezcGraphGdDriver();
+ $chart->renderer = new ezcGraphRenderer3d();
+ $chart->options->font = $this->basePath . 'font.ttf';
+ $chart->render( 500, 200, $filename );
+
+ $this->assertImageSimilar(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png',
+ 'Image does not look as expected.',
+ 2000
+ );
+ }
+
public function testRender3dLineChart()
{
$filename = $this->tempDir . __FUNCTION__ . '.png';
OpenPOWER on IntegriCloud