summaryrefslogtreecommitdiffstats
path: root/tests/background_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-01-24 10:45:35 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-01-24 10:45:35 +0000
commit937d04f2094624af45c0241bc75f3cbef4182c70 (patch)
tree86dd6071468f1b3e63a37e4a58228decb2e2464c /tests/background_test.php
parent16bdb8776708f401d085c29222a88a2ae7667ced (diff)
downloadzetacomponents-graph-937d04f2094624af45c0241bc75f3cbef4182c70.zip
zetacomponents-graph-937d04f2094624af45c0241bc75f3cbef4182c70.tar.gz
- Fixed issue #10056: Fixed drawing order for boxes with background and border
# SVG element order changed without visual difference in comparision images # Mind, that bug #9765 hast severe effect for big borders
Diffstat (limited to 'tests/background_test.php')
-rw-r--r--tests/background_test.php129
1 files changed, 129 insertions, 0 deletions
diff --git a/tests/background_test.php b/tests/background_test.php
index f16b5bb..c58b8ed 100644
--- a/tests/background_test.php
+++ b/tests/background_test.php
@@ -106,6 +106,135 @@ class ezcGraphBackgroundTest extends ezcGraphTestCase
$this->assertSame( 3, $pieChart->background->borderWidth );
}
+ public function testRenderPieChartWithBackgroundBorder()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->background->border = '#000000';
+ $chart->background->borderWidth = 1;
+
+ $chart->driver = new ezcGraphSvgDriver();
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
+ public function testRenderPieChartWithBigBackgroundBorder()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->background->border = '#000000';
+ $chart->background->borderWidth = 5;
+
+ $chart->driver = new ezcGraphSvgDriver();
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
+ public function testRenderPieChartWithBackgroundBorderAndPadding()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->background->border = '#000000';
+ $chart->background->borderWidth = 1;
+ $chart->background->padding = 2;
+
+ $chart->driver = new ezcGraphSvgDriver();
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
+ public function testRenderPieChartWithBackgroundBorderAndMargin()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->background->border = '#000000';
+ $chart->background->borderWidth = 1;
+ $chart->background->margin = 3;
+
+ $chart->driver = new ezcGraphSvgDriver();
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
+ public function testRenderPieChartWithBackgroundBorderAll()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->background->border = '#000000';
+ $chart->background->borderWidth = 2;
+ $chart->background->padding = 3;
+ $chart->background->margin = 3;
+
+ $chart->driver = new ezcGraphSvgDriver();
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
public function testRenderPieChartWithBackgroundBottomRight()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
OpenPOWER on IntegriCloud