summaryrefslogtreecommitdiffstats
path: root/tests/background_test.php
diff options
context:
space:
mode:
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