From ccc75f9a0f37cf808a4dda2dc68b731e0be177ef Mon Sep 17 00:00:00 2001 From: Kore Nordmann Date: Mon, 7 Jan 2008 09:59:44 +0000 Subject: - Fixed issue #11777: Optionally independent axis font configuration --- ...aphLineChartTest_testLineChartUnsyncedFonts.svg | 2 + ...hLineChartTest_testLineChartUnsyncedFonts3d.svg | 2 + tests/line_test.php | 49 ++++++++++++++++++++++ tests/renderer_2d_test.php | 29 +++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts.svg create mode 100644 tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts3d.svg (limited to 'tests') diff --git a/tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts.svg b/tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts.svg new file mode 100644 index 0000000..a147df8 --- /dev/null +++ b/tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts.svg @@ -0,0 +1,2 @@ + +sampleIEOperawgetSafari010002000300040005000 diff --git a/tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts3d.svg b/tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts3d.svg new file mode 100644 index 0000000..86befdb --- /dev/null +++ b/tests/data/compare/ezcGraphLineChartTest_testLineChartUnsyncedFonts3d.svg @@ -0,0 +1,2 @@ + +sampleIEOperawgetSafari010002000300040005000 diff --git a/tests/line_test.php b/tests/line_test.php index 48d1052..432bd9f 100644 --- a/tests/line_test.php +++ b/tests/line_test.php @@ -956,6 +956,55 @@ class ezcGraphLineChartTest extends ezcGraphTestCase ); } + public function testLineChartUnsyncedFonts() + { + $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->renderer->options->syncAxisFonts = false; + + $chart->driver = new ezcGraphSvgDriver(); + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testLineChartUnsyncedFonts3d() + { + $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->renderer = new ezcGraphRenderer3d(); + $chart->renderer->options->syncAxisFonts = false; + + $chart->driver = new ezcGraphSvgDriver(); + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + public function testStackedBarChart() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php index 892faa8..16d8508 100644 --- a/tests/renderer_2d_test.php +++ b/tests/renderer_2d_test.php @@ -2191,6 +2191,35 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase $this->fail( 'Expected ezcBaseValueException.' ); } + public function testRendererOptionsPropertySyncAxisFonts() + { + $options = new ezcGraphRendererOptions(); + + $this->assertSame( + true, + $options->syncAxisFonts, + 'Wrong default value for property syncAxisFonts in class ezcGraphRendererOptions' + ); + + $options->syncAxisFonts = false; + $this->assertSame( + false, + $options->syncAxisFonts, + 'Setting property value did not work for property syncAxisFonts in class ezcGraphRendererOptions' + ); + + try + { + $options->syncAxisFonts = 42; + } + catch ( ezcBaseValueException $e ) + { + return true; + } + + $this->fail( 'Expected ezcBaseValueException.' ); + } + public function testRendererOptionsPropertySymbolSize() { $options = new ezcGraphRendererOptions(); -- cgit v1.1