File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
tests/PhpSpreadsheetTests/Shared Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 28
28
- name : Install locales
29
29
run : sudo apt-get install -y language-pack-fr language-pack-de
30
30
31
+ - name : Install single-byte locale
32
+ run : sudo sed -i -e 's/# de_DE@euro/de_DE@euro/g' /etc/locale.gen && sudo locale-gen de_DE@euro
33
+
31
34
- name : Setup PHP, with composer and extensions
32
35
uses : shivammathur/setup-php@v2
33
36
with :
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ protected function tearDown(): void
32
32
33
33
public function testCurrency (): void
34
34
{
35
- if (!setlocale (LC_ALL , 'de_DE.UTF-8 ' , 'deu_deu.utf8 ' )) {
35
+ if ($ this -> currentLocale === false || !setlocale (LC_ALL , 'de_DE.UTF-8 ' , 'deu_deu.utf8 ' )) {
36
36
self ::markTestSkipped ('Unable to set German UTF8 locale for testing. ' );
37
37
}
38
38
$ result = StringHelper::getCurrencyCode ();
@@ -46,10 +46,9 @@ public function testCurrency(): void
46
46
$ result = StringHelper::getCurrencyCode ();
47
47
self ::assertSame ('$ ' , $ result , 'locale now used ' );
48
48
StringHelper::setCurrencyCode (null );
49
- if (!setlocale (LC_ALL , 'deu_deu ' , 'de_DE ' )) {
49
+ if (!setlocale (LC_ALL , 'deu_deu ' , 'de_DE@euro ' )) {
50
50
self ::markTestSkipped ('Unable to set German single-byte locale for testing. ' );
51
51
}
52
- // Seems like Linux returns trailing blank, Win doesn't
53
52
$ result = StringHelper::getCurrencyCode (true ); // trim if alt symbol is used
54
53
self ::assertSame ('EUR ' , $ result , 'non-UTF8 result ignored ' );
55
54
}
You can’t perform that action at this time.
0 commit comments