From f0766614423afbe25011206f8b8ea194c2aaa5e9 Mon Sep 17 00:00:00 2001 From: saper Date: Mon, 26 Oct 2015 23:44:48 +0100 Subject: [PATCH] Reset serialize_precision to stabilize tests 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 49b91c3808..fab6dfb5eb 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -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() { -- 2.20.1