Locale-specific float to string is changed in PHP as per https://wiki.php.net/rfc/locale_independent_float_to_string

This commit is contained in:
MarkBaker 2020-10-09 15:59:59 +02:00
parent e3b9b0d29c
commit 930fdc1b0c
1 changed files with 2 additions and 1 deletions

View File

@ -54,6 +54,7 @@ class LocaleFloatsTest extends TestCase
preg_match('/(?:double|float)\(([^\)]+)\)/mui', ob_get_clean(), $matches);
self::assertArrayHasKey(1, $matches);
$actual = $matches[1];
self::assertEquals('1,1', $actual);
// From PHP8, https://wiki.php.net/rfc/locale_independent_float_to_string applies
self::assertEquals((\PHP_VERSION_ID < 80000) ? '1,1' : '1.1', $actual);
}
}