make sure locale is restored correct in tests

This commit is contained in:
Ceeram 2012-03-04 00:36:21 +01:00
parent 169c99cedf
commit 2a7bee0a5c
3 changed files with 5 additions and 5 deletions

View file

@ -146,7 +146,7 @@ class MysqlTest extends CakeTestCase {
public function testLocalizedFloats() { public function testLocalizedFloats() {
$this->skipIf(DS === '\\', 'The locale is not supported in Windows and affect the others tests.'); $this->skipIf(DS === '\\', 'The locale is not supported in Windows and affect the others tests.');
$restore = setlocale(LC_ALL, null); $restore = setlocale(LC_ALL, 0);
setlocale(LC_ALL, 'de_DE'); setlocale(LC_ALL, 'de_DE');
$result = $this->Dbo->value(3.141593); $result = $this->Dbo->value(3.141593);

View file

@ -344,7 +344,7 @@ class PostgresTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testLocalizedFloats() { public function testLocalizedFloats() {
$restore = setlocale(LC_ALL, null); $restore = setlocale(LC_ALL, 0);
setlocale(LC_ALL, 'de_DE'); setlocale(LC_ALL, 'de_DE');
$result = $this->db->value(3.141593, 'float'); $result = $this->db->value(3.141593, 'float');

View file

@ -6253,7 +6253,7 @@ class ModelWriteTest extends BaseModelTest {
* @return void * @return void
*/ */
public function testWriteFloatAsGerman() { public function testWriteFloatAsGerman() {
$restore = setlocale(LC_ALL, null); $restore = setlocale(LC_ALL, 0);
setlocale(LC_ALL, 'de_DE'); setlocale(LC_ALL, 'de_DE');
$model = new DataTest(); $model = new DataTest();