Skip to content

Commit

Permalink
Try Default Locale Rather than English
Browse files Browse the repository at this point in the history
  • Loading branch information
oleibman committed Dec 23, 2024
1 parent 81440e7 commit eed339f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v4

- name: Install locales
run: sudo apt-get install -y language-pack-fr language-pack-de language-pack-en
run: sudo apt-get install -y language-pack-fr language-pack-de

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions tests/PhpSpreadsheetTests/Shared/StringHelperLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public function testCurrency(): void
}
$result = StringHelper::getCurrencyCode();
self::assertSame('', $result);
if (!setlocale(LC_ALL, 'en_ca', 'en_CA')) {
self::markTestSkipped('Unable to set en_ca locale for testing.');
if (!setlocale(LC_ALL, $this->currentLocale)) {

Check failure on line 40 in tests/PhpSpreadsheetTests/Shared/StringHelperLocaleTest.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter #2 $locale of function setlocale expects string|null, string|false given.
self::markTestSkipped('Unable to restore default locale.');
}
$result = StringHelper::getCurrencyCode();
self::assertSame('', $result, 'result persists despite locale change');
Expand Down

0 comments on commit eed339f

Please sign in to comment.