From 76f4b27a1480af26e27d57e21faea8ebbc927cbc Mon Sep 17 00:00:00 2001 From: Samuel Demirdjian Date: Sat, 28 May 2016 14:06:39 +0300 Subject: [PATCH] Make tests independent from application locale --- tests/kohana/DateTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/kohana/DateTest.php b/tests/kohana/DateTest.php index 66c41ac9..5ecc266a 100644 --- a/tests/kohana/DateTest.php +++ b/tests/kohana/DateTest.php @@ -17,6 +17,7 @@ class Kohana_DateTest extends Unittest_TestCase { protected $_original_timezone = NULL; + protected $default_locale; /** * Ensures we have a consistant timezone for testing. @@ -28,8 +29,10 @@ class Kohana_DateTest extends Unittest_TestCase parent::setUp(); $this->_original_timezone = date_default_timezone_get(); + $this->default_locale = setlocale(LC_ALL, 0); date_default_timezone_set('America/Chicago'); + setlocale(LC_ALL, 'en_US.utf8'); } /** @@ -40,6 +43,7 @@ class Kohana_DateTest extends Unittest_TestCase // @codingStandardsIgnoreEnd { date_default_timezone_set($this->_original_timezone); + setlocale(LC_ALL, $this->default_locale); parent::tearDown(); } -- 2.11.4.GIT