From ae311d59bf94eb135dfaa1c09dd93e1ebea4ee05 Mon Sep 17 00:00:00 2001 From: Kore Nordmann Date: Wed, 16 Aug 2006 08:00:03 +0000 Subject: - Created generic renderer options class - Changed output driver in renderer tests to SVG for faster testcases --- ...Renderer2dTest_testRenderFilledLineBarChart.png | Bin 76616 -> 0 bytes ...Renderer2dTest_testRenderFilledLineBarChart.svg | 2 + ...aphRenderer2dTest_testRenderFilledLineChart.png | Bin 87482 -> 0 bytes ...aphRenderer2dTest_testRenderFilledLineChart.svg | 2 + ...stRenderFilledLineChartWithAxisIntersection.png | Bin 86880 -> 0 bytes ...stRenderFilledLineChartWithAxisIntersection.svg | 2 + .../ezcGraphRenderer2dTest_testRenderLineChart.png | Bin 87622 -> 0 bytes .../ezcGraphRenderer2dTest_testRenderLineChart.svg | 2 + .../ezcGraphRenderer2dTest_testRenderPieChart.png | Bin 82033 -> 0 bytes .../ezcGraphRenderer2dTest_testRenderPieChart.svg | 2 + ...testRenderPieChartWithBackgroundBottomRight.png | Bin 87091 -> 0 bytes ...testRenderPieChartWithBackgroundBottomRight.svg | 2 + ...Renderer2dTest_testRenderPieChartWithOffset.svg | 2 + ...est_testRenderPieChartWithTextureBackground.png | Bin 77027 -> 0 bytes ...est_testRenderPieChartWithTextureBackground.svg | 2 + ...hRenderer3dTest_testRender3dFilledLineChart.png | Bin 92275 -> 0 bytes ...hRenderer3dTest_testRender3dFilledLineChart.svg | 2 + ...st_testRender3dFilledLineChartNonFilledAxis.png | Bin 93014 -> 0 bytes ...st_testRender3dFilledLineChartNonFilledAxis.svg | 2 + ...st_testRender3dFilledLineChartNonFilledGrid.png | Bin 92269 -> 0 bytes ...st_testRender3dFilledLineChartNonFilledGrid.svg | 2 + ...Render3dFilledLineChartWithAxisIntersection.png | Bin 91208 -> 0 bytes ...Render3dFilledLineChartWithAxisIntersection.svg | 2 + ...estRender3dFilledLineChartWithoutDataBorder.png | Bin 91044 -> 0 bytes ...estRender3dFilledLineChartWithoutDataBorder.svg | 2 + ...zcGraphRenderer3dTest_testRender3dLineChart.png | Bin 91901 -> 0 bytes ...zcGraphRenderer3dTest_testRender3dLineChart.svg | 2 + ...r3dTest_testRender3dLineChartBigMaxFontSize.png | Bin 92314 -> 0 bytes ...r3dTest_testRender3dLineChartBigMaxFontSize.svg | 2 + ...dTest_testRender3dLineChartSmallMaxFontSize.png | Bin 91586 -> 0 bytes ...dTest_testRender3dLineChartSmallMaxFontSize.svg | 2 + .../ezcGraphRenderer3dTest_testRenderBarChart.png | Bin 73671 -> 0 bytes .../ezcGraphRenderer3dTest_testRenderBarChart.svg | 2 + ...aphRenderer3dTest_testRenderBarChartSymbols.png | Bin 118204 -> 0 bytes ...aphRenderer3dTest_testRenderBarChartSymbols.svg | 2 + ...hRenderer3dTest_testRenderLabeledPieSegment.png | Bin 78485 -> 0 bytes ...hRenderer3dTest_testRenderLabeledPieSegment.svg | 2 + ...est_testRenderLabeledPieSegmentPolygonOrder.png | Bin 88792 -> 0 bytes ...est_testRenderLabeledPieSegmentPolygonOrder.svg | 2 + ...testRenderLabeledPieSegmentWithCustomHeight.png | Bin 78201 -> 0 bytes ...testRenderLabeledPieSegmentWithCustomHeight.svg | 2 + ...stRenderLabeledPieSegmentWithCustomRotation.png | Bin 74813 -> 0 bytes ...stRenderLabeledPieSegmentWithCustomRotation.svg | 2 + ...RenderLabeledPieSegmentWithIncreasedMoveOut.png | Bin 77618 -> 0 bytes ...RenderLabeledPieSegmentWithIncreasedMoveOut.svg | 2 + ...3dTest_testRenderLabeledPieSegmentWithTitle.png | Bin 80872 -> 0 bytes ...3dTest_testRenderLabeledPieSegmentWithTitle.svg | 2 + ...estRenderLabeledPieSegmentWithoutDataBorder.png | Bin 77677 -> 0 bytes ...estRenderLabeledPieSegmentWithoutDataBorder.svg | 2 + ...t_testRenderLabeledPieSegmentWithoutSymbols.png | Bin 76348 -> 0 bytes ...t_testRenderLabeledPieSegmentWithoutSymbols.svg | 2 + ...rer3dTest_testRenderNegativeBarChartSymbols.png | Bin 120783 -> 0 bytes ...rer3dTest_testRenderNegativeBarChartSymbols.svg | 2 + ...estRenderPieChartWithBackgroundBottomCenter.png | Bin 87097 -> 0 bytes ...estRenderPieChartWithBackgroundBottomCenter.svg | 2 + ...nderPieChartWithHorizontalTextureBackground.png | Bin 83769 -> 0 bytes ...nderPieChartWithHorizontalTextureBackground.svg | 2 + ...er3dTest_testRenderPieChartWithLotsOfLabels.png | Bin 105263 -> 0 bytes ...er3dTest_testRenderPieChartWithLotsOfLabels.svg | 2 + ...Renderer3dTest_testRenderPieChartWithOffset.svg | 2 + tests/renderer_2d_test.php | 139 ++++++---- tests/renderer_3d_test.php | 290 +++++++++++---------- 62 files changed, 302 insertions(+), 189 deletions(-) delete mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.png create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.svg delete mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.png create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.svg delete mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.png create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.svg delete mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.png create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.svg delete mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.png create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.svg delete mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.png create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.svg create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithOffset.svg delete mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.png create mode 100644 tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.svg delete mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.png create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.svg create mode 100644 tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithOffset.svg (limited to 'tests') diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.png b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.png deleted file mode 100644 index 7a0efbe..0000000 Binary files a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.svg new file mode 100644 index 0000000..c200d2e --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineBarChart.svg @@ -0,0 +1,2 @@ + +Line 0Line 1Line 2sample 1sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.png b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.png deleted file mode 100644 index 2134b72..0000000 Binary files a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.svg new file mode 100644 index 0000000..0e9ce91 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChart.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.png b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.png deleted file mode 100644 index 8f159f6..0000000 Binary files a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.svg new file mode 100644 index 0000000..c0a46ab --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderFilledLineChartWithAxisIntersection.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 5-2500250500750 diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.png b/tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.png deleted file mode 100644 index d0e9ca0..0000000 Binary files a/tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.svg new file mode 100644 index 0000000..e771934 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderLineChart.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.png b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.png deleted file mode 100644 index 109163d..0000000 Binary files a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.svg new file mode 100644 index 0000000..d74d964 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChart.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.png b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.png deleted file mode 100644 index b57b378..0000000 Binary files a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.svg new file mode 100644 index 0000000..1ead3d6 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithBackgroundBottomRight.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithOffset.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithOffset.svg new file mode 100644 index 0000000..0730d7c --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithOffset.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariMozilla: 4375 (61.3%)Safari: 987 (13.8%)wget: 231 (3.2%)IE: 345 (4.8%)Opera: 1204 (16.9%) diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.png b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.png deleted file mode 100644 index 91c1b66..0000000 Binary files a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.svg b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.svg new file mode 100644 index 0000000..7d5792a --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithTextureBackground.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.png deleted file mode 100644 index b9ff474..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.svg new file mode 100644 index 0000000..8ebd9ac --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChart.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.png deleted file mode 100644 index 0f29346..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.svg new file mode 100644 index 0000000..958c915 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledAxis.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.png deleted file mode 100644 index e431c63..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.svg new file mode 100644 index 0000000..1d8a393 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartNonFilledGrid.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.png deleted file mode 100644 index b052cec..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.svg new file mode 100644 index 0000000..21f0f92 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithAxisIntersection.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 5-2500250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.png deleted file mode 100644 index 9b2348f..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.svg new file mode 100644 index 0000000..5b543b0 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dFilledLineChartWithoutDataBorder.svg @@ -0,0 +1,2 @@ + +Line 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.png deleted file mode 100644 index d207407..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.svg new file mode 100644 index 0000000..e18c26d --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChart.svg @@ -0,0 +1,2 @@ + +Line chart titleLine 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.png deleted file mode 100644 index 833369a..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.svg new file mode 100644 index 0000000..7dea825 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartBigMaxFontSize.svg @@ -0,0 +1,2 @@ + +Line chart titleLine 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.png b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.png deleted file mode 100644 index 50e7302..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.svg new file mode 100644 index 0000000..0b4642c --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRender3dLineChartSmallMaxFontSize.svg @@ -0,0 +1,2 @@ + +Line chart titleLine 1Line 2sample 2sample 3sample 4sample 50250500750 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.png deleted file mode 100644 index 2636c84..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.svg new file mode 100644 index 0000000..fa01cc8 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChart.svg @@ -0,0 +1,2 @@ + +Line 0Line 1sample 1sample 2sample 3sample 4sample 50100200300400500 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.png deleted file mode 100644 index b78fe71..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.svg new file mode 100644 index 0000000..5d14586 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderBarChartSymbols.svg @@ -0,0 +1,2 @@ + +RectangleCircleBulletDiamondsample 1sample 2sample 3sample 4sample 50100200300400500 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.png deleted file mode 100644 index 7694e37..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.svg new file mode 100644 index 0000000..1136e1d --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegment.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.png deleted file mode 100644 index 4bcd8bc..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.svg new file mode 100644 index 0000000..af07280 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentPolygonOrder.svg @@ -0,0 +1,2 @@ + +label 8label 7label 6label 5label 4label 3label 9label 10label 1label 2 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.png deleted file mode 100644 index 6e87a9f..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.svg new file mode 100644 index 0000000..c4ed4fb --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomHeight.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.png deleted file mode 100644 index 32749c5..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.svg new file mode 100644 index 0000000..391fb82 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithCustomRotation.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.png deleted file mode 100644 index fe67334..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.svg new file mode 100644 index 0000000..c20e59e --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithIncreasedMoveOut.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.png deleted file mode 100644 index 54dc155..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.svg new file mode 100644 index 0000000..54b613a --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithTitle.svg @@ -0,0 +1,2 @@ + +Pie chart titleMozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla: 4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.png deleted file mode 100644 index e5eb5f3..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.svg new file mode 100644 index 0000000..7e7f86a --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutDataBorder.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.png deleted file mode 100644 index f6de42a..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.svg new file mode 100644 index 0000000..322c55b --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderLabeledPieSegmentWithoutSymbols.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.png deleted file mode 100644 index 9b8c284..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.svg new file mode 100644 index 0000000..9d696bf --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderNegativeBarChartSymbols.svg @@ -0,0 +1,2 @@ + +RectangleCircleBulletDiamondsample -1sample -2sample -3sample -4sample -5-500-400-300-200-1000 diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.png deleted file mode 100644 index 6744087..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.svg new file mode 100644 index 0000000..12e0e08 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithBackgroundBottomCenter.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.png deleted file mode 100644 index 923830f..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.svg new file mode 100644 index 0000000..8356a63 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithHorizontalTextureBackground.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla:4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.png b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.png deleted file mode 100644 index c3cf507..0000000 Binary files a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.png and /dev/null differ diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.svg new file mode 100644 index 0000000..14b0409 --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithLotsOfLabels.svg @@ -0,0 +1,2 @@ + +NorwegianDutchGermanFrenchHindiTaiwaneseBrazilianVenezuelanJapaneseCzechHungarianRomanianTaiwanese: 1 (4.0%)Hindi: 1 (4.0%)French: 2 (8.0%)German: 2 (8.0%)Dutch: 3 (12.0%)Brazilian: 1 (4.0%)Venezuelan: 1 (4.0%)Japanese: 1 (4.0%)Czech: 1 (4.0%)Hungarian: 1 (4.0%)Romanian: 1 (4.0%)Norwegian: 10 (40.0%) diff --git a/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithOffset.svg b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithOffset.svg new file mode 100644 index 0000000..cf52c8f --- /dev/null +++ b/tests/data/compare/ezcGraphRenderer3dTest_testRenderPieChartWithOffset.svg @@ -0,0 +1,2 @@ + +MozillaIEOperawgetSafariMozilla: 4375 (61.3%)Safari: 987 (13.8%)wget: 231 (3.2%)IE: 345 (4.8%)Opera: 1204 (16.9%) diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php index 39c29b1..e1d4b9f 100644 --- a/tests/renderer_2d_test.php +++ b/tests/renderer_2d_test.php @@ -15,7 +15,7 @@ * @package ImageAnalysis * @subpackage Tests */ -class ezcGraphRenderer2dTest extends ezcImageTestCase +class ezcGraphRenderer2dTest extends ezcTestCase { protected $basePath; @@ -44,7 +44,7 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $this->renderer = new ezcGraphRenderer2d(); - $this->driver = $this->getMock( 'ezcGraphGdDriver', array( + $this->driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawPolygon', 'drawLine', 'drawTextBox', @@ -66,7 +66,37 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase */ public function tearDown() { - $this->removeTempDir(); + if ( !$this->hasFailed() ) + { + $this->removeTempDir(); + } + } + + /** + * Compares a generated image with a stored file + * + * @param string $generated Filename of generated image + * @param string $compare Filename of stored image + * @return void + */ + protected function compare( $generated, $compare ) + { + $this->assertTrue( + file_exists( $generated ), + 'No image file has been created.' + ); + + $this->assertTrue( + file_exists( $compare ), + 'Comparision image does not exist.' + ); + + if ( md5_file( $generated ) !== md5_file( $compare ) ) + { + // Adding a diff makes no sense here, because created XML uses + // only two lines + $this->fail( 'Rendered image is not correct.'); + } } public function testRenderLabeledPieSegment() @@ -149,7 +179,7 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase 0 ); - $this->renderer->render( 'foo.png' ); + $this->renderer->render( 'foo.svg' ); } public function testRenderNonLabeledPieSegment() @@ -189,7 +219,7 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase 0 ); - $this->renderer->render( 'foo.png' ); + $this->renderer->render( 'foo.svg' ); } public function testRenderNonLabeledPieSegmentMoveOut() @@ -229,7 +259,7 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase true ); - $this->renderer->render( 'foo.png' ); + $this->renderer->render( 'foo.svg' ); } public function testRenderLotsOfLabeledPieSegments() @@ -292,7 +322,7 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $this->renderer->drawPieSegment( new ezcGraphBoundings( 0, 0, 400, 200 ), ezcGraphColor::fromHex( '#FF0000' ), 45, 70, 'Label 4', true ); $this->renderer->drawPieSegment( new ezcGraphBoundings( 0, 0, 400, 200 ), ezcGraphColor::fromHex( '#FF0000' ), 70, 119, 'Label 5', true ); - $this->renderer->render( 'foo.png' ); + $this->renderer->render( 'foo.svg' ); } public function testRenderBar() @@ -1521,7 +1551,7 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase public function testRenderLineChart() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -1529,21 +1559,19 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderFilledLineChart() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -1552,21 +1580,19 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderFilledLineBarChart() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -1581,21 +1607,19 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer(); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderFilledLineChartWithAxisIntersection() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -1604,21 +1628,19 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => -151, 'sample 3' => 324, 'sample 4' => -120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => -5, 'sample 5' => -124) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderPieChart() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -1631,21 +1653,19 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $chart->data['sample']->highlight['Safari'] = true; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderPieChartWithBackgroundBottomRight() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -1660,21 +1680,19 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $chart->background->image = dirname( __FILE__ ) . '/data/ez.png'; $chart->background->position = ezcGraph::BOTTOM | ezcGraph::RIGHT; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderPieChartWithTextureBackground() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -1689,15 +1707,38 @@ class ezcGraphRenderer2dTest extends ezcImageTestCase $chart->background->image = dirname( __FILE__ ) . '/data/texture.png'; $chart->background->repeat = ezcGraph::HORIZONTAL | ezcGraph::VERTICAL; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); + $chart->options->font = $this->basePath . 'font.ttf'; + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testRenderPieChartWithOffset() + { + $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->renderer->options->pieChartOffset = 156; + + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } } diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php index b6ec129..cd991f4 100644 --- a/tests/renderer_3d_test.php +++ b/tests/renderer_3d_test.php @@ -15,7 +15,7 @@ * @package ImageAnalysis * @subpackage Tests */ -class ezcGraphRenderer3dTest extends ezcImageTestCase +class ezcGraphRenderer3dTest extends ezcTestCase { protected $basePath; @@ -52,9 +52,36 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase } } + /** + * Compares a generated image with a stored file + * + * @param string $generated Filename of generated image + * @param string $compare Filename of stored image + * @return void + */ + protected function compare( $generated, $compare ) + { + $this->assertTrue( + file_exists( $generated ), + 'No image file has been created.' + ); + + $this->assertTrue( + file_exists( $compare ), + 'Comparision image does not exist.' + ); + + if ( md5_file( $generated ) !== md5_file( $compare ) ) + { + // Adding a diff makes no sense here, because created XML uses + // only two lines + $this->fail( 'Rendered image is not correct.'); + } + } + public function testRenderBackgroundImage() { - $driver = $this->getMock( 'ezcGraphGdDriver', array( + $driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawImage', ) ); @@ -81,7 +108,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase public function testRenderTopLeftBackgroundImage() { - $driver = $this->getMock( 'ezcGraphGdDriver', array( + $driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawImage', ) ); @@ -109,7 +136,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase public function testRenderBottomRightBackgroundImage() { - $driver = $this->getMock( 'ezcGraphGdDriver', array( + $driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawImage', ) ); @@ -137,7 +164,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase public function testRenderToBigBackgroundImage() { - $driver = $this->getMock( 'ezcGraphGdDriver', array( + $driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawImage', ) ); @@ -165,7 +192,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase public function testRenderBackgroundImageRepeatX() { - $driver = $this->getMock( 'ezcGraphGdDriver', array( + $driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawImage', ) ); @@ -212,7 +239,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase public function testRenderBackgroundImageRepeatY() { - $driver = $this->getMock( 'ezcGraphGdDriver', array( + $driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawImage', ) ); @@ -250,7 +277,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase public function testRenderBackgroundImageRepeatBoth() { - $driver = $this->getMock( 'ezcGraphGdDriver', array( + $driver = $this->getMock( 'ezcGraphSvgDriver', array( 'drawImage', ) ); @@ -297,7 +324,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase public function testRenderLabeledPieSegment() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -311,21 +338,19 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['sample']->highlight['Safari'] = true; $chart->renderer = new ezcGraphRenderer3d(); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderLabeledPieSegmentWithTitle() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -341,21 +366,19 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->title = 'Pie chart title'; $chart->renderer = new ezcGraphRenderer3d(); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderLabeledPieSegmentPolygonOrder() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -378,21 +401,19 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->moveOut = .3; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderLabeledPieSegmentWithoutSymbols() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -408,21 +429,19 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->showSymbol = false; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderLabeledPieSegmentWithIncreasedMoveOut() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -438,21 +457,19 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->moveOut = .2; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderLabeledPieSegmentWithoutDataBorder() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -468,21 +485,19 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->dataBorder = 0; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderLabeledPieSegmentWithCustomHeight() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -498,21 +513,19 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->pieChartHeight = 5; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderLabeledPieSegmentWithCustomRotation() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -528,43 +541,39 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->pieChartRotation = .3; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderPieChartWithLotsOfLabels() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['Skien'] = new ezcGraphArrayDataSet( array( 'Norwegian' => 10, 'Dutch' => 3, 'German' => 2, 'French' => 2, 'Hindi' => 1, 'Taiwanese' => 1, 'Brazilian' => 1, 'Venezuelan' => 1, 'Japanese' => 1, 'Czech' => 1, 'Hungarian' => 1, 'Romanian' => 1 ) ); $chart->data['Skien']->highlight['Norwegian'] = true; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderBarChart() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -574,22 +583,20 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); $chart->data['Line 1']->symbol = ezcGraph::NO_SYMBOL; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderBarChartSymbols() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -603,22 +610,20 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Diamond'] = new ezcGraphArrayDataSet( array( 'sample 1' => 387, 'sample 2' => 261, 'sample 3' => 24, 'sample 4' => 59, 'sample 5' => 112) ); $chart->data['Diamond']->symbol = ezcGraph::DIAMOND; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 700, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderNegativeBarChartSymbols() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -632,22 +637,20 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Diamond'] = new ezcGraphArrayDataSet( array( 'sample -1' => -387, 'sample -2' => -261, 'sample -3' => -24, 'sample -4' => -59, 'sample -5' => -112) ); $chart->data['Diamond']->symbol = ezcGraph::DIAMOND; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 700, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dLineChart() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -657,22 +660,20 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->title = 'Line chart title'; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dLineChartSmallMaxFontSize() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -682,23 +683,21 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->title = 'Line chart title'; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->title->font->maxFontSize = 8; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dLineChartBigMaxFontSize() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -709,23 +708,21 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->title = 'Line chart title'; $chart->title->maxHeight = .2; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->title->font->maxFontSize = 32; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dFilledLineChart() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -734,22 +731,20 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dFilledLineChartWithAxisIntersection() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -758,22 +753,20 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => -151, 'sample 3' => 324, 'sample 4' => -120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => -5, 'sample 5' => -124) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dFilledLineChartWithoutDataBorder() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -781,24 +774,22 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->dataBorder = 0; $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dFilledLineChartNonFilledGrid() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -806,24 +797,22 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->fillGrid = 1; $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRender3dFilledLineChartNonFilledAxis() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); @@ -831,24 +820,22 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); $chart->renderer = new ezcGraphRenderer3d(); $chart->renderer->options->fillAxis = 1; $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderPieChartWithBackgroundBottomCenter() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -863,21 +850,20 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->background->image = dirname( __FILE__ ) . '/data/ez.png'; $chart->background->position = ezcGraph::BOTTOM | ezcGraph::CENTER; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); + $chart->renderer = new ezcGraphRenderer3d(); $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } public function testRenderPieChartWithHorizontalTextureBackground() { - $filename = $this->tempDir . __FUNCTION__ . '.png'; + $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphPieChart(); $chart->data['sample'] = new ezcGraphArrayDataSet( array( @@ -893,15 +879,39 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->background->repeat = ezcGraph::HORIZONTAL; $chart->background->position = ezcGraph::BOTTOM; - $chart->driver = new ezcGraphGdDriver(); + $chart->driver = new ezcGraphSvgDriver(); + $chart->renderer = new ezcGraphRenderer3d(); + $chart->options->font = $this->basePath . 'font.ttf'; + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testRenderPieChartWithOffset() + { + $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->driver = new ezcGraphSvgDriver(); + $chart->renderer = new ezcGraphRenderer3d(); + $chart->renderer->options->pieChartOffset = 156; $chart->options->font = $this->basePath . 'font.ttf'; $chart->render( 500, 200, $filename ); - $this->assertImageSimilar( + $this->compare( $filename, - $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', - 'Image does not look as expected.', - 2000 + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } } -- cgit v1.1