Skip to content

Commit ce48fbe

Browse files
feature #52193 [PhpUnitBridge] Allow setting the locale using SYMFONY_PHPUNIT_LOCALE env var (VincentLanglet)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [PhpUnitBridge] Allow setting the locale using SYMFONY_PHPUNIT_LOCALE env var | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | yes | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #52185 | License | MIT cc `@nicolas`-grekas Commits ------- 2954468 [PhpUnitBridge] Allow setting the locale using SYMFONY_PHPUNIT_LOCALE env var
2 parents 3df3372 + 2954468 commit ce48fbe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Symfony/Bridge/PhpUnit/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
6.4
5+
---
6+
7+
* Allow setting the locale using `SYMFONY_PHPUNIT_LOCALE` env var
8+
49
6.3
510
---
611

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class SymfonyTestsListenerTrait
5050
*/
5151
public function __construct(array $mockedNamespaces = [])
5252
{
53+
setlocale(\LC_ALL, $_ENV['SYMFONY_PHPUNIT_LOCALE'] ?? 'C');
54+
5355
if (class_exists(ExcludeList::class)) {
5456
(new ExcludeList())->getExcludedDirectories();
5557
ExcludeList::addDirectory(\dirname((new \ReflectionClass(__CLASS__))->getFileName(), 2));

src/Symfony/Bridge/PhpUnit/bootstrap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
unset($GLOBALS['__composer_autoload_files'][$fileIdentifier]);
3030
}
3131

32-
// Enforce a consistent locale
33-
setlocale(\LC_ALL, 'C');
34-
3532
if (class_exists(Deprecation::class)) {
3633
Deprecation::withoutDeduplication();
3734

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy