From 93062e252a16efeaea9c95484232a009a1569a51 Mon Sep 17 00:00:00 2001 From: Kore Nordmann Date: Sat, 21 Dec 2013 11:32:05 +0100 Subject: Ensure correct locale in all tests --- tests/axis_boxed_renderer_test.php | 4 +++- tests/axis_centered_renderer_test.php | 4 +++- tests/axis_exact_renderer_test.php | 6 ++++-- tests/axis_rotated_boxed_renderer_test.php | 6 ++++-- tests/axis_rotated_renderer_test.php | 6 ++++-- tests/axis_space_test.php | 6 ++++-- tests/background_test.php | 6 ++++-- tests/chart_test.php | 6 ++++-- .../compare/ezcGraphSvgDriverTest_testSvgWithDifferentLocales.svg | 2 +- .../ezcGraphSvgSvgFontDriverTest_testSvgWithDifferentLocales.svg | 2 +- tests/dataset_average_test.php | 6 ++++-- tests/dataset_numeric_test.php | 6 ++++-- tests/date_axis_test.php | 6 ++++-- tests/driver_cairo_oo_test.php | 6 ++++-- tests/driver_cairo_test.php | 6 ++++-- tests/driver_flash_test.php | 6 ++++-- tests/driver_gd_test.php | 6 ++++-- tests/driver_svg_svg_font_test.php | 8 ++++---- tests/driver_svg_test.php | 8 ++++---- tests/font_test.php | 6 ++++-- tests/horizontal_bar_chart_renderer_test.php | 6 ++++-- tests/image_map_test.php | 6 ++++-- tests/labeled_axis_test.php | 6 ++++-- tests/legend_test.php | 6 ++++-- tests/line_test.php | 6 ++++-- tests/logarithmical_axis_test.php | 6 ++++-- tests/multiple_axis_test.php | 6 ++++-- tests/odometer_test.php | 6 ++++-- tests/pie_test.php | 6 ++++-- tests/radar_axis_test.php | 8 ++++---- tests/radar_chart_test.php | 6 ++++-- tests/renderer_2d_legacy_test.php | 8 ++++---- tests/renderer_2d_test.php | 8 ++++---- tests/renderer_3d_test.php | 8 ++++---- tests/test_case.php | 5 +++++ tests/text_test.php | 4 +++- tests/tools_test.php | 7 ++++--- 37 files changed, 140 insertions(+), 80 deletions(-) diff --git a/tests/axis_boxed_renderer_test.php b/tests/axis_boxed_renderer_test.php index 32c63ad..9e29333 100644 --- a/tests/axis_boxed_renderer_test.php +++ b/tests/axis_boxed_renderer_test.php @@ -42,8 +42,10 @@ class ezcGraphAxisBoxedRendererTest extends ezcTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphAxisBoxedRendererTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + if ( version_compare( phpversion(), '5.1.3', '<' ) ) { $this->markTestSkipped( "These tests required atleast PHP 5.1.3" ); diff --git a/tests/axis_centered_renderer_test.php b/tests/axis_centered_renderer_test.php index c82c98a..ef7ce2b 100644 --- a/tests/axis_centered_renderer_test.php +++ b/tests/axis_centered_renderer_test.php @@ -42,8 +42,10 @@ class ezcGraphAxisCenteredRendererTest extends ezcTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphAxisCenteredRendererTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + if ( version_compare( phpversion(), '5.1.3', '<' ) ) { $this->markTestSkipped( "These tests required atleast PHP 5.1.3" ); diff --git a/tests/axis_exact_renderer_test.php b/tests/axis_exact_renderer_test.php index 85ebd65..62c4519 100644 --- a/tests/axis_exact_renderer_test.php +++ b/tests/axis_exact_renderer_test.php @@ -48,8 +48,10 @@ class ezcGraphAxisExactRendererTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( __CLASS__ ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) @@ -61,7 +63,7 @@ class ezcGraphAxisExactRendererTest extends ezcGraphTestCase $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/axis_rotated_boxed_renderer_test.php b/tests/axis_rotated_boxed_renderer_test.php index 94c0c77..ece2794 100644 --- a/tests/axis_rotated_boxed_renderer_test.php +++ b/tests/axis_rotated_boxed_renderer_test.php @@ -48,8 +48,10 @@ class ezcGraphAxisRotatedBoxedRendererTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( __CLASS__ ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) @@ -61,7 +63,7 @@ class ezcGraphAxisRotatedBoxedRendererTest extends ezcGraphTestCase $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/axis_rotated_renderer_test.php b/tests/axis_rotated_renderer_test.php index 8d6ec2c..f136d12 100644 --- a/tests/axis_rotated_renderer_test.php +++ b/tests/axis_rotated_renderer_test.php @@ -48,8 +48,10 @@ class ezcGraphAxisRotatedRendererTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphAxisRotatedRendererTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) @@ -61,7 +63,7 @@ class ezcGraphAxisRotatedRendererTest extends ezcGraphTestCase $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/axis_space_test.php b/tests/axis_space_test.php index 1d514c3..b7db7cf 100644 --- a/tests/axis_space_test.php +++ b/tests/axis_space_test.php @@ -46,13 +46,15 @@ class ezcGraphAxisSpaceTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( __CLASS__ ); } - protected function setUp() + public function setUp() { + parent::setUp(); + $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++self::$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/background_test.php b/tests/background_test.php index 2bdbc42..778f3f9 100644 --- a/tests/background_test.php +++ b/tests/background_test.php @@ -46,15 +46,17 @@ class ezcGraphBackgroundTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphBackgroundTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/chart_test.php b/tests/chart_test.php index 821bf2a..a9bc35c 100644 --- a/tests/chart_test.php +++ b/tests/chart_test.php @@ -50,15 +50,17 @@ class ezcGraphChartTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphChartTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/data/compare/ezcGraphSvgDriverTest_testSvgWithDifferentLocales.svg b/tests/data/compare/ezcGraphSvgDriverTest_testSvgWithDifferentLocales.svg index cfb782a..3d0af95 100644 --- a/tests/data/compare/ezcGraphSvgDriverTest_testSvgWithDifferentLocales.svg +++ b/tests/data/compare/ezcGraphSvgDriverTest_testSvgWithDifferentLocales.svg @@ -1,2 +1,2 @@ -MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla: 4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) +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/ezcGraphSvgSvgFontDriverTest_testSvgWithDifferentLocales.svg b/tests/data/compare/ezcGraphSvgSvgFontDriverTest_testSvgWithDifferentLocales.svg index 574c856..a7c899c 100644 --- a/tests/data/compare/ezcGraphSvgSvgFontDriverTest_testSvgWithDifferentLocales.svg +++ b/tests/data/compare/ezcGraphSvgSvgFontDriverTest_testSvgWithDifferentLocales.svg @@ -2036,4 +2036,4 @@ -MozillaIEOperawgetSafariOpera: 1204 (16.9%)IE: 345 (4.8%)Mozilla: 4375 (61.3%)wget: 231 (3.2%)Safari: 987 (13.8%) +MozillaIEOperawgetSafariOpera: 1204 (16,9%)IE: 345 (4,8%)Mozilla: 4375 (61,3%)wget: 231 (3,2%)Safari: 987 (13,8%) diff --git a/tests/dataset_average_test.php b/tests/dataset_average_test.php index 52e96b9..ee5fc4e 100644 --- a/tests/dataset_average_test.php +++ b/tests/dataset_average_test.php @@ -44,14 +44,16 @@ class ezcGraphDataSetAverageTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphDataSetAverageTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/dataset_numeric_test.php b/tests/dataset_numeric_test.php index ddd5253..69cacc4 100644 --- a/tests/dataset_numeric_test.php +++ b/tests/dataset_numeric_test.php @@ -44,14 +44,16 @@ class ezcGraphNumericDataSetTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphNumericDataSetTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/date_axis_test.php b/tests/date_axis_test.php index 2a2853e..fa2f962 100644 --- a/tests/date_axis_test.php +++ b/tests/date_axis_test.php @@ -46,8 +46,10 @@ class ezcGraphDateAxisTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphDateAxisTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + date_default_timezone_set( 'Europe/Berlin' ); static $i = 0; @@ -58,7 +60,7 @@ class ezcGraphDateAxisTest extends ezcGraphTestCase $this->chart->xAxis = new ezcGraphChartElementDateAxis(); } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/driver_cairo_oo_test.php b/tests/driver_cairo_oo_test.php index d4b0d71..5056b2e 100644 --- a/tests/driver_cairo_oo_test.php +++ b/tests/driver_cairo_oo_test.php @@ -48,8 +48,10 @@ class ezcGraphCairoOODriverTest extends ezcTestImageCase return new PHPUnit_Framework_TestSuite( __CLASS__ ); } - protected function setUp() + public function setUp() { + parent::setUp(); + if ( !ezcBaseFeatures::hasExtensionSupport( 'cairo' ) ) { $this->markTestSkipped( 'This test needs pecl/cairo support.' ); @@ -65,7 +67,7 @@ class ezcGraphCairoOODriverTest extends ezcTestImageCase $this->driver->options->font->path = $this->basePath . 'font.ttf'; } - protected function tearDown() + public function tearDown() { unset( $this->driver ); if ( !$this->hasFailed() ) diff --git a/tests/driver_cairo_test.php b/tests/driver_cairo_test.php index 51c1208..68c6b7d 100644 --- a/tests/driver_cairo_test.php +++ b/tests/driver_cairo_test.php @@ -48,8 +48,10 @@ class ezcGraphCairoDriverTest extends ezcTestImageCase return new PHPUnit_Framework_TestSuite( "ezcGraphCairoDriverTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + if ( !ezcBaseFeatures::hasExtensionSupport( 'cairo_wrapper' ) ) { $this->markTestSkipped( 'This test needs pecl/cairo_wrapper support.' ); @@ -65,7 +67,7 @@ class ezcGraphCairoDriverTest extends ezcTestImageCase $this->driver->options->font->path = $this->basePath . 'font.ttf'; } - protected function tearDown() + public function tearDown() { unset( $this->driver ); if ( !$this->hasFailed() ) diff --git a/tests/driver_flash_test.php b/tests/driver_flash_test.php index 18d7b13..5c0e13e 100644 --- a/tests/driver_flash_test.php +++ b/tests/driver_flash_test.php @@ -52,8 +52,10 @@ class ezcGraphFlashDriverTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphFlashDriverTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + if ( !ezcBaseFeatures::hasExtensionSupport( 'ming' ) ) { $this->markTestSkipped( 'This test needs ext/ming support.' ); @@ -70,7 +72,7 @@ class ezcGraphFlashDriverTest extends ezcGraphTestCase $this->driver->options->font->path = $this->basePath . 'fdb_font.fdb'; } - protected function tearDown() + public function tearDown() { unset( $this->driver ); if ( !$this->hasFailed() ) diff --git a/tests/driver_gd_test.php b/tests/driver_gd_test.php index f9df921..6280ddf 100644 --- a/tests/driver_gd_test.php +++ b/tests/driver_gd_test.php @@ -50,8 +50,10 @@ class ezcGraphGdDriverTest extends ezcTestImageCase return new PHPUnit_Framework_TestSuite( "ezcGraphGdDriverTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + if ( !ezcBaseFeatures::hasExtensionSupport( 'gd' ) && ( ezcBaseFeatures::hasFunction( 'imagefttext' ) || ezcBaseFeatures::hasFunction( 'imagettftext' ) ) ) { @@ -69,7 +71,7 @@ class ezcGraphGdDriverTest extends ezcTestImageCase $this->driver->options->supersampling = 1; } - protected function tearDown() + public function tearDown() { unset( $this->driver ); if ( !$this->hasFailed() ) diff --git a/tests/driver_svg_svg_font_test.php b/tests/driver_svg_svg_font_test.php index b1d3329..3134f5e 100644 --- a/tests/driver_svg_svg_font_test.php +++ b/tests/driver_svg_svg_font_test.php @@ -52,8 +52,10 @@ class ezcGraphSvgSvgFontDriverTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( __CLASS__ ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; @@ -65,15 +67,13 @@ class ezcGraphSvgSvgFontDriverTest extends ezcGraphTestCase $this->driver->options->font->path = $this->basePath . 'font.svg'; } - protected function tearDown() + public function tearDown() { unset( $this->driver ); if ( !$this->hasFailed() ) { $this->removeTempDir(); } - - $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); } public function testDrawTextBoxShortString() diff --git a/tests/driver_svg_test.php b/tests/driver_svg_test.php index f02bda6..f8ed502 100644 --- a/tests/driver_svg_test.php +++ b/tests/driver_svg_test.php @@ -52,8 +52,10 @@ class ezcGraphSvgDriverTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphSvgDriverTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; @@ -63,15 +65,13 @@ class ezcGraphSvgDriverTest extends ezcGraphTestCase $this->driver->options->height = 100; } - protected function tearDown() + public function tearDown() { unset( $this->driver ); if ( !$this->hasFailed() ) { $this->removeTempDir(); } - - $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); } public function testRenderToOutput() diff --git a/tests/font_test.php b/tests/font_test.php index 678e756..b247ae7 100644 --- a/tests/font_test.php +++ b/tests/font_test.php @@ -44,14 +44,16 @@ class ezcGraphFontTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphFontTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { unset( $this->driver ); if ( !$this->hasFailed() ) diff --git a/tests/horizontal_bar_chart_renderer_test.php b/tests/horizontal_bar_chart_renderer_test.php index 396326c..4055135 100644 --- a/tests/horizontal_bar_chart_renderer_test.php +++ b/tests/horizontal_bar_chart_renderer_test.php @@ -44,14 +44,16 @@ class ezcGraphHorizontalBarRendererTests extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( __CLASS__ ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/image_map_test.php b/tests/image_map_test.php index 2bfa993..bd2f5e2 100644 --- a/tests/image_map_test.php +++ b/tests/image_map_test.php @@ -48,14 +48,16 @@ class ezcGraphImageMapTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphImageMapTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/labeled_axis_test.php b/tests/labeled_axis_test.php index e206d68..cb61292 100644 --- a/tests/labeled_axis_test.php +++ b/tests/labeled_axis_test.php @@ -44,15 +44,17 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphLabeledAxisTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/legend_test.php b/tests/legend_test.php index 0d8ef66..2daebdd 100644 --- a/tests/legend_test.php +++ b/tests/legend_test.php @@ -40,15 +40,17 @@ class ezcGraphLegendTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphLegendTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/line_test.php b/tests/line_test.php index 1623610..62aee3c 100644 --- a/tests/line_test.php +++ b/tests/line_test.php @@ -44,8 +44,10 @@ class ezcGraphLineChartTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphLineChartTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) { @@ -55,7 +57,7 @@ class ezcGraphLineChartTest extends ezcGraphTestCase $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/logarithmical_axis_test.php b/tests/logarithmical_axis_test.php index ed2c594..a230e56 100644 --- a/tests/logarithmical_axis_test.php +++ b/tests/logarithmical_axis_test.php @@ -44,14 +44,16 @@ class ezcGraphLogarithmicalAxisTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphLogarithmicalAxisTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/multiple_axis_test.php b/tests/multiple_axis_test.php index 93a281b..9d2c125 100644 --- a/tests/multiple_axis_test.php +++ b/tests/multiple_axis_test.php @@ -44,15 +44,17 @@ class ezcGraphMultipleAxisTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphMultipleAxisTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/odometer_test.php b/tests/odometer_test.php index 97d10ab..f15d3e9 100644 --- a/tests/odometer_test.php +++ b/tests/odometer_test.php @@ -44,8 +44,10 @@ class ezcGraphOdometerChartTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphOdometerChartTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) { @@ -55,7 +57,7 @@ class ezcGraphOdometerChartTest extends ezcGraphTestCase $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/pie_test.php b/tests/pie_test.php index a6731d9..0f2d62d 100644 --- a/tests/pie_test.php +++ b/tests/pie_test.php @@ -44,8 +44,10 @@ class ezcGraphPieChartTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphPieChartTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) { @@ -55,7 +57,7 @@ class ezcGraphPieChartTest extends ezcGraphTestCase $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/radar_axis_test.php b/tests/radar_axis_test.php index 482bba9..0f2bf8a 100644 --- a/tests/radar_axis_test.php +++ b/tests/radar_axis_test.php @@ -44,16 +44,16 @@ class ezcGraphRadarChartAxisTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphRadarChartAxisTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; - - $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/radar_chart_test.php b/tests/radar_chart_test.php index 42f71f9..c611433 100644 --- a/tests/radar_chart_test.php +++ b/tests/radar_chart_test.php @@ -44,8 +44,10 @@ class ezcGraphRadarChartTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphRadarChartTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) { @@ -55,7 +57,7 @@ class ezcGraphRadarChartTest extends ezcGraphTestCase $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/renderer_2d_legacy_test.php b/tests/renderer_2d_legacy_test.php index d0c8cc1..d196321 100644 --- a/tests/renderer_2d_legacy_test.php +++ b/tests/renderer_2d_legacy_test.php @@ -48,16 +48,16 @@ class ezcGraphRenderer2dLegacyTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( __CLASS__ ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) { $this->markTestSkipped( "This test requires PHP 5.1.3 or later." ); } - $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); - $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; @@ -78,7 +78,7 @@ class ezcGraphRenderer2dLegacyTest extends ezcGraphTestCase $this->driver->options->height = 200; } - protected function tearDown() + public function tearDown() { $this->renderer = null; $this->driver = null; diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php index 7cb6385..e684cfd 100644 --- a/tests/renderer_2d_test.php +++ b/tests/renderer_2d_test.php @@ -48,16 +48,16 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphRenderer2dTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) { $this->markTestSkipped( "This test requires PHP 5.1.3 or later." ); } - $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); - $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; @@ -78,7 +78,7 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase $this->driver->options->height = 200; } - protected function tearDown() + public function tearDown() { $this->driver = null; $this->renderer = null; diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php index 1548247..cf5dcd7 100644 --- a/tests/renderer_3d_test.php +++ b/tests/renderer_3d_test.php @@ -44,8 +44,10 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphRenderer3dTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; if ( version_compare( phpversion(), '5.1.3', '<' ) ) @@ -53,13 +55,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase $this->markTestSkipped( "This test requires PHP 5.1.3 or later." ); } - $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); - $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { diff --git a/tests/test_case.php b/tests/test_case.php index 258a241..86755b1 100644 --- a/tests/test_case.php +++ b/tests/test_case.php @@ -26,6 +26,11 @@ abstract class ezcGraphTestCase extends ezcTestImageCase { + public function setUp() + { + $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); + } + /** * Normalize given PHP code for flash generation * diff --git a/tests/text_test.php b/tests/text_test.php index 8d070f5..3f2c2dd 100644 --- a/tests/text_test.php +++ b/tests/text_test.php @@ -38,8 +38,10 @@ class ezcGraphTextTest extends ezcTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphTextTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + if ( version_compare( phpversion(), '5.1.3', '<' ) ) { $this->markTestSkipped( "This test requires PHP 5.1.3 or later." ); diff --git a/tests/tools_test.php b/tests/tools_test.php index 7c80c84..ae0fe09 100644 --- a/tests/tools_test.php +++ b/tests/tools_test.php @@ -40,15 +40,16 @@ class ezcGraphToolsTest extends ezcGraphTestCase return new PHPUnit_Framework_TestSuite( "ezcGraphToolsTest" ); } - protected function setUp() + public function setUp() { + parent::setUp(); + static $i = 0; $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/'; $this->basePath = dirname( __FILE__ ) . '/data/'; - $this->setLocale( LC_NUMERIC, 'en_US', 'en_US.UTF-8', 'en_US.UTF8', 'en', 'english', 'en_US@euro' ); } - protected function tearDown() + public function tearDown() { if ( !$this->hasFailed() ) { -- cgit v1.1