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. *