Skip to content

Commit

Permalink
Only change locale for LC_NUMERIC instead of LC_ALL, on some installs…
Browse files Browse the repository at this point in the history
… this woudl cause an error:

"setlocale(): Specified locale name is too long"
  • Loading branch information
ceeram committed Jun 19, 2012
1 parent cf18e8d commit 8b94d9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -147,8 +147,8 @@ public function testQuoting() {
public function testLocalizedFloats() {
$this->skipIf(DS === '\\', 'The locale is not supported in Windows and affect the others tests.');

$restore = setlocale(LC_ALL, 0);
setlocale(LC_ALL, 'de_DE');
$restore = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, 'de_DE');

$result = $this->Dbo->value(3.141593);
$this->assertEquals('3.141593', $result);
Expand All @@ -171,7 +171,7 @@ public function testLocalizedFloats() {
$result = $this->db->value(2.2E-54);
$this->assertEquals('2.2E-54', (string)$result);

setlocale(LC_ALL, $restore);
setlocale(LC_NUMERIC, $restore);
}

/**
Expand Down

0 comments on commit 8b94d9e

Please sign in to comment.