-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support ecma_intl.default_locale INI setting
- Loading branch information
Showing
8 changed files
with
188 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
ecma_intl.default_locale has an empty string when set to empty | ||
--EXTENSIONS-- | ||
ecma_intl | ||
--INI-- | ||
ecma_intl.default_locale= | ||
--FILE-- | ||
<?php | ||
declare(strict_types=1); | ||
|
||
var_dump(ini_get('ecma_intl.default_locale')); | ||
|
||
--EXPECT-- | ||
string(0) "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
ecma_intl.default_locale has an empty string when set to an invalid value | ||
--EXTENSIONS-- | ||
ecma_intl | ||
--INI-- | ||
ecma_intl.default_locale=foobar | ||
--FILE-- | ||
<?php | ||
declare(strict_types=1); | ||
|
||
var_dump(ini_get('ecma_intl.default_locale')); | ||
|
||
--EXPECT-- | ||
string(0) "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
ecma_intl.default_locale has a value when set to a valid value | ||
--EXTENSIONS-- | ||
ecma_intl | ||
--INI-- | ||
ecma_intl.default_locale=en-US | ||
--FILE-- | ||
<?php | ||
declare(strict_types=1); | ||
|
||
var_dump(ini_get('ecma_intl.default_locale')); | ||
|
||
--EXPECT-- | ||
string(5) "en-US" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
ecma_intl.default_locale can be set to en-US-POSIX | ||
--EXTENSIONS-- | ||
ecma_intl | ||
--INI-- | ||
ecma_intl.default_locale=en-US-POSIX | ||
--FILE-- | ||
<?php | ||
declare(strict_types=1); | ||
|
||
var_dump(ini_get('ecma_intl.default_locale')); | ||
|
||
--EXPECT-- | ||
string(11) "en-US-POSIX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
ecma_intl.default_locale cannot recognize underscores in locale IDs | ||
--EXTENSIONS-- | ||
ecma_intl | ||
--INI-- | ||
ecma_intl.default_locale=en_US_POSIX | ||
--FILE-- | ||
<?php | ||
declare(strict_types=1); | ||
|
||
var_dump(ini_get('ecma_intl.default_locale')); | ||
|
||
--EXPECT-- | ||
string(0) "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--TEST-- | ||
ecma_intl.default_locale can be set from the application | ||
--EXTENSIONS-- | ||
ecma_intl | ||
--INI-- | ||
ecma_intl.default_locale= | ||
--FILE-- | ||
<?php | ||
declare(strict_types=1); | ||
|
||
var_dump(ini_set('ecma_intl.default_locale', 'en-US')); | ||
var_dump(ini_set('ecma_intl.default_locale', 'foobar')); | ||
var_dump(ini_set('ecma_intl.default_locale', 'en-Latn-US')); | ||
var_dump(ini_set('ecma_intl.default_locale', 'en-US-POSIX')); | ||
var_dump(ini_set('ecma_intl.default_locale', 'de')); | ||
var_dump(ini_get('ecma_intl.default_locale')); | ||
|
||
--EXPECT-- | ||
string(0) "" | ||
bool(false) | ||
string(5) "en-US" | ||
string(10) "en-Latn-US" | ||
string(11) "en-US-POSIX" | ||
string(2) "de" |