More test coverage
Run youtube-dl with --restrict-filenames in order to avoid issues when testing against different locales
This commit is contained in:
parent
419110f764
commit
0a66dce2b8
7 changed files with 190 additions and 29 deletions
|
@ -17,13 +17,6 @@ use Slim\Http\Response;
|
|||
*/
|
||||
class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Original locale.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $origlocale;
|
||||
|
||||
/**
|
||||
* LocaleMiddleware instance.
|
||||
*
|
||||
|
@ -36,23 +29,11 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->origlocale = getenv('LANG');
|
||||
$container = new Container();
|
||||
$container['locale'] = new LocaleManager();
|
||||
$this->middleware = new LocaleMiddleware($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore environment after the tests.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
putenv('LANG='.$this->origlocale);
|
||||
setlocale(LC_ALL, $this->origlocale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the testLocale() function.
|
||||
*
|
||||
|
@ -114,6 +95,11 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that the environment is correctly set up.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testEnv()
|
||||
{
|
||||
$this->markTestIncomplete('We need to find a way to reliably test LC_ALL and LANG values');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue