Reset serialize_precision to stabilize tests
authorsaper <saper@saper.info>
Mon, 26 Oct 2015 22:44:48 +0000 (23:44 +0100)
committersaper <saper@saper.info>
Mon, 26 Oct 2015 22:55:48 +0000 (23:55 +0100)
With serialize_precision = 100 the following
failures were generated:

1) ApiFormatPhpTest::testGeneralEncoding with data set #7
(array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(1))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-a:1:{i:0;d:1.0E+42;}
+a:1:{i:0;d:1000000000000000044885712678075916785549312;}

/usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61
/usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137

2) ApiFormatPhpTest::testGeneralEncoding with data set #30
(array(1.0E+42), 'a:1:{i:0;d:1.0E+42;}', array(2))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-a:1:{i:0;d:1.0E+42;}
+a:1:{i:0;d:1000000000000000044885712678075916785549312;}

/usr/home/saper/public_html/ybabel/tests/phpunit/includes/api/format/ApiFormatTestBase.php:61
/usr/home/saper/public_html/ybabel/tests/phpunit/MediaWikiTestCase.php:137

Bug: T116683
Change-Id: I5e760b4632d2ab326954fe5769476e143c376d7c

tests/phpunit/phpunit.php

index 49b91c3..fab6dfb 100755 (executable)
@@ -113,6 +113,11 @@ class PHPUnitMaintClass extends Maintenance {
                );
                // xdebug's default of 100 is too low for MediaWiki
                ini_set( 'xdebug.max_nesting_level', 1000 );
+
+               // Bug T116683 serialize_precision of 100
+               // may break testing against floating point values
+               // treated with PHP's serialize()
+               ini_set( 'serialize_precision', 14 );
        }
 
        public function execute() {