bug #15145 [Bridge/PhpUnit] Enforce a consistent locale (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Bridge/PhpUnit] Enforce a consistent locale

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Will fix some HHVM failures

Commits
-------

b04fe83 [Bridge/PhpUnit] Enforce a consistent locale
This commit is contained in:
Fabien Potencier 2015-06-30 11:32:10 +02:00
commit bfc174a178
2 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ Provides utilities for PHPUnit, especially user deprecation notices management.
It comes with the following features:
* disable the garbage collector;
* enforce a consistent `C` locale;
* auto-register `class_exists` to load Doctrine annotations;
* print a user deprecation notices summary at the end of the test suite.

View File

@ -14,6 +14,9 @@ if (PHP_VERSION_ID >= 50400 && gc_enabled()) {
gc_disable();
}
// Enforce a consistent locale
setlocale(LC_ALL, 'C');
if (class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
AnnotationRegistry::registerLoader('class_exists');
}