From 2a7bee0a5cc1144084c133c0b0e3f2f320b45021 Mon Sep 17 00:00:00 2001 From: Ceeram Date: Sun, 4 Mar 2012 00:36:21 +0100 Subject: [PATCH] make sure locale is restored correct in tests --- lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php | 6 +++--- .../Test/Case/Model/Datasource/Database/PostgresTest.php | 2 +- lib/Cake/Test/Case/Model/ModelWriteTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 9ac83e66f..863455655 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -146,7 +146,7 @@ class MysqlTest extends CakeTestCase { public function testLocalizedFloats() { $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'); $result = $this->Dbo->value(3.141593); @@ -3505,7 +3505,7 @@ class MysqlTest extends CakeTestCase { ->with("UPDATE `$db`.`articles` SET `field1` = 'value1' WHERE 1 = 1"); $this->Dbo->expects($this->at(1))->method('execute') - ->with("UPDATE `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` ON " . + ->with("UPDATE `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` ON " . "(`Article`.`user_id` = `User`.`id`)" . " SET `Article`.`field1` = 2 WHERE 2=2"); @@ -3538,7 +3538,7 @@ class MysqlTest extends CakeTestCase { ->with("DELETE FROM `$db`.`articles` WHERE 1 = 1"); $this->Dbo->expects($this->at(1))->method('execute') - ->with("DELETE `Article` FROM `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` " . + ->with("DELETE `Article` FROM `$db`.`articles` AS `Article` LEFT JOIN `$db`.`users` AS `User` " . "ON (`Article`.`user_id` = `User`.`id`)" . " WHERE 1 = 1"); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index 86965516d..fa772008d 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -344,7 +344,7 @@ class PostgresTest extends CakeTestCase { * @return void */ public function testLocalizedFloats() { - $restore = setlocale(LC_ALL, null); + $restore = setlocale(LC_ALL, 0); setlocale(LC_ALL, 'de_DE'); $result = $this->db->value(3.141593, 'float'); diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 80484e4a3..c61865917 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -6253,7 +6253,7 @@ class ModelWriteTest extends BaseModelTest { * @return void */ public function testWriteFloatAsGerman() { - $restore = setlocale(LC_ALL, null); + $restore = setlocale(LC_ALL, 0); setlocale(LC_ALL, 'de_DE'); $model = new DataTest();