Merge pull request #1523 from tersmitten/improved-tests-that-use-setlocale

Makes the locale test not always pass, be verbose when it is skipped.
This commit is contained in:
Mark Story 2013-08-14 16:54:50 -07:00
commit c040bb0cdc
3 changed files with 6 additions and 3 deletions

View file

@ -152,7 +152,8 @@ class MysqlTest extends CakeTestCase {
$this->skipIf(DS === '\\', 'The locale is not supported in Windows and affect the others tests.');
$restore = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, 'de_DE');
$this->skipIf(setlocale(LC_NUMERIC, 'de_DE') === false, "The German locale isn't available.");
$result = $this->Dbo->value(3.141593);
$this->assertEquals('3.141593', $result);

View file

@ -340,7 +340,8 @@ class PostgresTest extends CakeTestCase {
*/
public function testLocalizedFloats() {
$restore = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, 'de_DE');
$this->skipIf(setlocale(LC_NUMERIC, 'de_DE') === false, "The German locale isn't available.");
$result = $this->db->value(3.141593, 'float');
$this->assertEquals("3.141593", $result);

View file

@ -6472,7 +6472,8 @@ class ModelWriteTest extends BaseModelTest {
*/
public function testWriteFloatAsGerman() {
$restore = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, 'de_DE');
$this->skipIf(setlocale(LC_NUMERIC, 'de_DE') === false, "The German locale isn't available.");
$model = new DataTest();
$result = $model->save(array(