Fix integration tests when no locale with comma separator available

This commit is contained in:
jmleroux 2021-11-11 00:18:08 +01:00
parent e61261fc74
commit 1b4827db01
2 changed files with 10 additions and 0 deletions

View File

@ -291,12 +291,17 @@ class WriterTest extends TestCase
// Installed locales differ from one system to another, so we can't pick
// a given locale.
$supportedLocales = explode("\n", shell_exec('locale -a'));
$foundCommaLocale = false;
foreach ($supportedLocales as $supportedLocale) {
\setlocale(LC_ALL, $supportedLocale);
if (\localeconv()['decimal_point'] === ',') {
$foundCommaLocale = true;
break;
}
}
if (!$foundCommaLocale) {
$this->markTestSkipped('No locale with comma decimal separator');
}
$this->assertEquals(',', \localeconv()['decimal_point']);
$fileName = 'test_add_row_should_support_float_values_in_different_locale.xlsx';

View File

@ -406,12 +406,17 @@ class WriterTest extends TestCase
// Installed locales differ from one system to another, so we can't pick
// a given locale.
$supportedLocales = explode("\n", shell_exec('locale -a'));
$foundCommaLocale = false;
foreach ($supportedLocales as $supportedLocale) {
\setlocale(LC_ALL, $supportedLocale);
if (\localeconv()['decimal_point'] === ',') {
$foundCommaLocale = true;
break;
}
}
if (!$foundCommaLocale) {
$this->markTestSkipped('No locale with comma decimal separator');
}
$this->assertEquals(',', \localeconv()['decimal_point']);
$fileName = 'test_add_row_should_support_float_values_in_different_locale.xlsx';