summaryrefslogtreecommitdiffstats
path: root/tests/line_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-06-02 15:20:41 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-06-02 15:20:41 +0000
commit0ddff83b14071fb8694f0179de023d700952cb32 (patch)
tree3584f944972f6ebd85477b5e913a014d04e71ef4 /tests/line_test.php
parentb6efb38bbd2ef8d9f9ac110b852ac36711b8c7a7 (diff)
downloadzetacomponents-graph-0ddff83b14071fb8694f0179de023d700952cb32.zip
zetacomponents-graph-0ddff83b14071fb8694f0179de023d700952cb32.tar.gz
- Added tests and implementation for text elements eg. chart title
Diffstat (limited to 'tests/line_test.php')
-rw-r--r--tests/line_test.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/line_test.php b/tests/line_test.php
index 566c327..2b498b0 100644
--- a/tests/line_test.php
+++ b/tests/line_test.php
@@ -236,6 +236,48 @@ class ezcGraphLineChartTest extends ezcTestCase
$this->fail( $e->getMessage() );
}
}
+
+ public function testCompleteRendering()
+ {
+ try
+ {
+ $chart = ezcGraph::create( 'Line' );
+ $chart->title = 'Test graph';
+ $this->addSampleData( $chart );
+ $chart->driver = new ezcGraphGdDriver();
+ $chart->options->font = $this->basePath . 'font.ttf';
+ $chart->legend->font = $this->basePath . 'font2.ttf';
+ $chart->render( 500, 200, 'test.png' );
+ }
+ catch ( Exception $e )
+ {
+ echo $e;
+ $this->fail( $e->getMessage() );
+ }
+
+ $this->assertEquals(
+ $this->basePath . 'font.ttf',
+ $chart->options->font->font,
+ 'General font face should be the old one.'
+ );
+
+ $this->assertEquals(
+ $this->basePath . 'font.ttf',
+ $chart->title->font->font,
+ 'Font face for X axis should be the old one.'
+ );
+
+ $this->assertTrue(
+ $chart->legend->font instanceof ezcGraphFontOptions,
+ 'No fontOptions object was created.'
+ );
+
+ $this->assertEquals(
+ $this->basePath . 'font2.ttf',
+ $chart->legend->font->font,
+ 'Font face for legend has not changed.'
+ );
+ }
}
?>
OpenPOWER on IntegriCloud