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:
commit
bfc174a178
@ -6,6 +6,7 @@ Provides utilities for PHPUnit, especially user deprecation notices management.
|
|||||||
It comes with the following features:
|
It comes with the following features:
|
||||||
|
|
||||||
* disable the garbage collector;
|
* disable the garbage collector;
|
||||||
|
* enforce a consistent `C` locale;
|
||||||
* auto-register `class_exists` to load Doctrine annotations;
|
* auto-register `class_exists` to load Doctrine annotations;
|
||||||
* print a user deprecation notices summary at the end of the test suite.
|
* print a user deprecation notices summary at the end of the test suite.
|
||||||
|
|
||||||
|
@ -14,6 +14,9 @@ if (PHP_VERSION_ID >= 50400 && gc_enabled()) {
|
|||||||
gc_disable();
|
gc_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enforce a consistent locale
|
||||||
|
setlocale(LC_ALL, 'C');
|
||||||
|
|
||||||
if (class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
|
if (class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
|
||||||
AnnotationRegistry::registerLoader('class_exists');
|
AnnotationRegistry::registerLoader('class_exists');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user