From e64bb9b9f56263f9f4ab44fdc09e7c7682a5d20f Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 29 May 2017 22:00:30 +0200 Subject: [PATCH] Fix tests --- tests/LocaleMiddlewareTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index d350d3f..de54aee 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -15,14 +15,33 @@ use Slim\Http\Response; */ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase { + /** + * Original locale. + * + * @var string + */ + private $locale; + /** * Prepare tests. */ protected function setUp() { + $this->locale = getenv('LANG'); $this->middleware = new LocaleMiddleware(); } + /** + * Restore environment after the tests. + * + * @return void + */ + protected function tearDown() + { + putenv('LANG='.$this->locale); + setlocale(LC_ALL, $this->locale); + } + /** * Test the testLocale() function. *