summaryrefslogtreecommitdiffstats
path: root/tests/renderer_2d_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/renderer_2d_test.php')
-rw-r--r--tests/renderer_2d_test.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php
index cc2da38..81f4b96 100644
--- a/tests/renderer_2d_test.php
+++ b/tests/renderer_2d_test.php
@@ -1570,6 +1570,64 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase
10
);
}
+
+ public function testRenderPieChartWithBackgroundBottomRight()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.png';
+
+ $chart = new ezcGraphPieChart();
+ $chart['sample'] = array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ );
+
+ $chart->background->color = '#FFFFFFDD';
+ $chart->background->image = dirname( __FILE__ ) . '/data/ez.png';
+ $chart->background->position = ezcGraph::BOTTOM | ezcGraph::RIGHT;
+
+ $chart->driver = new ezcGraphGdDriver();
+ $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.',
+ 10
+ );
+ }
+
+ public function testRenderPieChartWithTextureBackground()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.png';
+
+ $chart = new ezcGraphPieChart();
+ $chart['sample'] = array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ );
+
+ $chart->background->color = '#FFFFFFDD';
+ $chart->background->image = dirname( __FILE__ ) . '/data/texture.png';
+ $chart->background->repeat = ezcGraph::HORIZONTAL | ezcGraph::VERTICAL;
+
+ $chart->driver = new ezcGraphGdDriver();
+ $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.',
+ 10
+ );
+ }
}
?>
OpenPOWER on IntegriCloud