From b04fe832ac893b40dba67ce47f877fe59c27253d Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 30 Jun 2015 08:53:17 +0200 Subject: [PATCH] [Bridge/PhpUnit] Enforce a consistent locale --- src/Symfony/Bridge/PhpUnit/README.md | 1 + src/Symfony/Bridge/PhpUnit/bootstrap.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/Symfony/Bridge/PhpUnit/README.md b/src/Symfony/Bridge/PhpUnit/README.md index 734df8baa0..afc9d8dd3b 100644 --- a/src/Symfony/Bridge/PhpUnit/README.md +++ b/src/Symfony/Bridge/PhpUnit/README.md @@ -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. diff --git a/src/Symfony/Bridge/PhpUnit/bootstrap.php b/src/Symfony/Bridge/PhpUnit/bootstrap.php index 91504ae4a8..199186fa4f 100644 --- a/src/Symfony/Bridge/PhpUnit/bootstrap.php +++ b/src/Symfony/Bridge/PhpUnit/bootstrap.php @@ -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'); }