summaryrefslogtreecommitdiffstats
path: root/tests/complete_rendering_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/complete_rendering_test.php')
-rw-r--r--tests/complete_rendering_test.php46
1 files changed, 44 insertions, 2 deletions
diff --git a/tests/complete_rendering_test.php b/tests/complete_rendering_test.php
index ff8d954..92b4d83 100644
--- a/tests/complete_rendering_test.php
+++ b/tests/complete_rendering_test.php
@@ -15,7 +15,7 @@
* @package ImageAnalysis
* @subpackage Tests
*/
-class ezcGraphCompleteRenderingTest extends ezcTestCase
+class ezcGraphCompleteRenderingTest extends ezcImageTestCase
{
protected $testFiles = array(
@@ -58,7 +58,7 @@ class ezcGraphCompleteRenderingTest extends ezcTestCase
$filename = $this->tempDir . __FUNCTION__ . '.png';
$chart = ezcGraph::create( 'line' );
- $chart->palette = 'black';
+ $chart->palette = 'Black';
$chart['Line 1'] = array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
$chart['Line 2'] = array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613);
@@ -74,6 +74,48 @@ class ezcGraphCompleteRenderingTest extends ezcTestCase
);
}
+ public function testRenderLineChartAxis()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.png';
+
+ $renderer = $this->getMock( 'ezcGraphRenderer2D', array(
+ 'drawAxis',
+ ) );
+
+ $chart = ezcGraph::create( 'line' );
+ $chart->palette = 'Black';
+
+ $renderer
+ ->expects( $this->at( 0 ) )
+ ->method( 'drawAxis' )
+ ->with(
+ $this->equalTo( new ezcGraphBoundings( 100, 0, 500, 200 ), 1. ),
+ $this->equalTo( new ezcGraphCoordinate( 0, 180 ), 1. ),
+ $this->equalTo( new ezcGraphCoordinate( 400, 180 ), 1. ),
+ $this->equalTo( $chart->xAxis ),
+ $this->equalTo( $chart->xAxis->axisLabelRenderer )
+ );
+ $renderer
+ ->expects( $this->at( 1 ) )
+ ->method( 'drawAxis' )
+ ->with(
+ $this->equalTo( new ezcGraphBoundings( 100, 0, 500, 200 ), 1. ),
+ $this->equalTo( new ezcGraphCoordinate( 40, 200 ), 1. ),
+ $this->equalTo( new ezcGraphCoordinate( 40, 0 ), 1. ),
+ $this->equalTo( $chart->yAxis ),
+ $this->equalTo( $chart->yAxis->axisLabelRenderer )
+ );
+
+ $chart['Line 1'] = array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+ $chart['Line 2'] = array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613);
+
+ $chart->renderer = $renderer;
+
+ $chart->driver = new ezcGraphGdDriver();
+ $chart->options->font = $this->basePath . 'font.ttf';
+ $chart->render( 500, 200, $filename );
+ }
+
public function testRenderWithTransparentBackground()
{
$filename = $this->tempDir . __FUNCTION__ . '.png';
OpenPOWER on IntegriCloud