test(phpunit): Fix ConfigTest on Windows

This commit is contained in:
Pierre Rudloff 2019-04-21 19:14:23 +02:00
parent dc4eafe33f
commit 28b99861c2
2 changed files with 15 additions and 10 deletions

View file

@ -14,9 +14,11 @@ use PHPUnit\Framework\TestCase;
abstract class BaseTest extends TestCase
{
/**
* Prepare tests.
* Get the config file used in tests.
*
* @return string Path to file
*/
protected function setUp()
protected function getConfigFile()
{
if (PHP_OS == 'WINNT') {
$configFile = 'config_test_windows.yml';
@ -24,7 +26,15 @@ abstract class BaseTest extends TestCase
$configFile = 'config_test.yml';
}
Config::setFile(__DIR__.'/../config/'.$configFile);
return __DIR__.'/../config/'.$configFile;
}
/**
* Prepare tests.
*/
protected function setUp()
{
Config::setFile($this->getConfigFile());
}
/**