diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-08-14 12:50:28 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-08-14 12:50:28 +0000 |
commit | 48155e33dd6901e3966d9b151d837bcbdc8e9968 (patch) | |
tree | 04fbae229bbf0a5bbea14d3e4da3f0bd976a4572 /tests/renderer_3d_test.php | |
parent | 21f7809f953a75b9e6214d0549a7f1941e3df7b9 (diff) | |
download | zetacomponents-graph-48155e33dd6901e3966d9b151d837bcbdc8e9968.zip zetacomponents-graph-48155e33dd6901e3966d9b151d837bcbdc8e9968.tar.gz |
- Changed datsets to accept instances of ezcGraphDataSet only
- Added bar charts
- Globally increase acceptable difference noise for created images in tests
Diffstat (limited to 'tests/renderer_3d_test.php')
-rw-r--r-- | tests/renderer_3d_test.php | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php index 1cb25e1..5d93447 100644 --- a/tests/renderer_3d_test.php +++ b/tests/renderer_3d_test.php @@ -297,13 +297,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart['sample']->highlight['Safari'] = true; @@ -316,7 +316,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -325,13 +325,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart['sample']->highlight['Safari'] = true; @@ -346,7 +346,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -355,7 +355,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'label 1' => 20, 'label 2' => 20, 'label 3' => 20, @@ -366,7 +366,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase 'label 8' => 20, 'label 9' => 20, 'label 10' => 20, - ); + ) ); $chart['sample']->highlight = true; $chart->options->label = '%1$s'; @@ -383,7 +383,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -392,13 +392,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart['sample']->highlight['Safari'] = true; @@ -413,7 +413,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -422,13 +422,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart['sample']->highlight['Safari'] = true; @@ -443,7 +443,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -452,13 +452,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart['sample']->highlight['Safari'] = true; @@ -473,7 +473,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -482,13 +482,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart['sample']->highlight['Safari'] = true; @@ -503,7 +503,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -512,13 +512,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart['sample']->highlight['Safari'] = true; @@ -533,7 +533,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -542,7 +542,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['Skien'] = 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['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['Skien']->highlight['Norwegian'] = true; @@ -555,7 +555,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -566,8 +566,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); - $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['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); $chart->title = 'Line chart title'; @@ -580,7 +580,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -591,8 +591,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); - $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['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); $chart->title = 'Line chart title'; @@ -606,7 +606,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -617,8 +617,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); - $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['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) ); $chart->title = 'Line chart title'; $chart->title->maxHeight = .2; @@ -633,7 +633,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -645,8 +645,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->palette = new ezcGraphPaletteBlack(); $chart->options->fillLines = 200; - $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['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart['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->renderer = new ezcGraphRenderer3d(); @@ -657,7 +657,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -669,8 +669,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart->palette = new ezcGraphPaletteBlack(); $chart->options->fillLines = 200; - $chart['Line 1'] = array( 'sample 1' => 234, 'sample 2' => -151, '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' => -124); + $chart['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => -151, 'sample 3' => 324, 'sample 4' => -120, 'sample 5' => 1) ); + $chart['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->renderer = new ezcGraphRenderer3d(); @@ -681,7 +681,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -692,8 +692,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); - $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['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart['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->renderer = new ezcGraphRenderer3d(); @@ -706,7 +706,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -717,8 +717,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); - $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['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart['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->renderer = new ezcGraphRenderer3d(); @@ -731,7 +731,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -742,8 +742,8 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $chart = new ezcGraphLineChart(); $chart->palette = new ezcGraphPaletteBlack(); - $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['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart['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->renderer = new ezcGraphRenderer3d(); @@ -756,7 +756,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -765,13 +765,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart->background->color = '#FFFFFFDD'; $chart->background->image = dirname( __FILE__ ) . '/data/ez.png'; @@ -785,7 +785,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } @@ -794,13 +794,13 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename = $this->tempDir . __FUNCTION__ . '.png'; $chart = new ezcGraphPieChart(); - $chart['sample'] = array( + $chart['sample'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987, - ); + ) ); $chart->background->color = '#FFFFFFDD'; $chart->background->image = dirname( __FILE__ ) . '/data/texture.png'; @@ -815,7 +815,7 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase $filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', 'Image does not look as expected.', - 10 + 2000 ); } } |