summaryrefslogtreecommitdiffstats
path: root/tests/background_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2009-02-25 13:23:01 +0000
committerKore Nordmann <github@kore-nordmann.de>2009-02-25 13:23:01 +0000
commit315ef1f26d86d573a2443d6c23dbbdf6e699ebbb (patch)
tree2b45080a8d50f56b35e1c4110ee5d834e4c02c97 /tests/background_test.php
parent2345258851514b82300d66c8b07aa6ba8c076f61 (diff)
downloadzetacomponents-graph-315ef1f26d86d573a2443d6c23dbbdf6e699ebbb.zip
zetacomponents-graph-315ef1f26d86d573a2443d6c23dbbdf6e699ebbb.tar.gz
- Implemented feature #14400: Add shortcut to set background color
Diffstat (limited to 'tests/background_test.php')
-rw-r--r--tests/background_test.php49
1 files changed, 47 insertions, 2 deletions
diff --git a/tests/background_test.php b/tests/background_test.php
index 3d3f815..69dd5c5 100644
--- a/tests/background_test.php
+++ b/tests/background_test.php
@@ -101,11 +101,11 @@ class ezcGraphBackgroundTest extends ezcGraphTestCase
public function testSetOptionsBorderLineChart()
{
$lineChart = new ezcGraphLineChart();
- $lineChart->background->border = '#FF0000';
+ $lineChart->background = '#FF0000';
$this->assertEquals(
ezcGraphColor::fromHex( 'FF0000' ),
- $lineChart->background->border
+ $lineChart->background->color
);
}
@@ -353,5 +353,50 @@ class ezcGraphBackgroundTest extends ezcGraphTestCase
);
}
+ public function testRenderPieChartBackgroundColorShortcut()
+ {
+ $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 = '#2e3436';
+
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
+ public function testRenderLineChartBackgroundColorShortcut()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphLineChart();
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->background = '#2e3436';
+
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
}
?>
OpenPOWER on IntegriCloud