Fix tests
This commit is contained in:
parent
d78335d937
commit
e64bb9b9f5
1 changed files with 19 additions and 0 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue