@@ -7,8 +7,8 @@ The PHPUnit Bridge
77
88It comes with the following features:
99
10- * Forces the tests to use a consistent locale (``C ``) (if you create
11- locale-sensitive tests, use PHPUnit's ``setLocale() `` method);
10+ * Sets by default a consistent locale (``C ``) for your tests (if you
11+ create locale-sensitive tests, use PHPUnit's ``setLocale() `` method);
1212
1313* Auto-register ``class_exists `` to load Doctrine annotations (when used);
1414
@@ -402,6 +402,41 @@ Log Deprecations
402402For turning the verbose output off and write it to a log file instead you can use
403403``SYMFONY_DEPRECATIONS_HELPER='logFile=/path/deprecations.log' ``.
404404
405+ Setting The Locale For Tests
406+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
407+
408+ By default, the PHPUnit Bridge forces the locale to ``C `` to avoid locale
409+ issues in tests. This behavior can be changed by setting the
410+ ``SYMFONY_PHPUNIT_LOCALE `` environment variable to the desired locale:
411+
412+ .. code-block :: bash
413+
414+ # .env.test
415+ SYMFONY_PHPUNIT_LOCALE=" fr_FR"
416+
417+ Alternatively, you can set this environment variable in the PHPUnit
418+ configuration file:
419+
420+ .. code-block :: xml
421+
422+ <!-- https://phpunit.de/manual/6.0/en/appendixes.configuration.html -->
423+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
424+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/6.0/phpunit.xsd"
425+ >
426+
427+ <!-- ... -->
428+
429+ <php >
430+ <!-- ... -->
431+ <env name =" SYMFONY_PHPUNIT_LOCALE" value =" fr_FR" />
432+ </php >
433+ </phpunit >
434+
435+ .. versionadded :: 6.4
436+
437+ The support for the ``SYMFONY_PHPUNIT_LOCALE `` environment variable was
438+ introduced in Symfony 6.4.
439+
405440.. _write-assertions-about-deprecations :
406441
407442Write Assertions about Deprecations
0 commit comments