PHRAS-2859_tests-do-corrupt-conf_4.1

fix : configuration.yml is not modified by unit-tests anymore
This commit is contained in:
Jean-Yves Gaulier
2019-12-12 16:53:15 +01:00
parent 5a500b2f02
commit 915e7bcd32
12 changed files with 169 additions and 19 deletions

View File

@@ -15,6 +15,25 @@ use Symfony\Component\Process\ExecutableFinder;
*/
class AutoloaderGeneratorTest extends \PhraseanetTestCase
{
private $bkp = null;
public function setUp()
{
parent::setUp();
$this->bkp = self::$DI['app']['conf']->get('plugins');
}
public function tearDown()
{
if(is_null($this->bkp)) {
self::$DI['app']['conf']->remove('plugins');
}
else {
self::$DI['app']['conf']->set('plugins', $this->bkp);
}
parent::tearDown();
}
public function testGeneratedFileAfterInstall()
{
$pluginDir = __DIR__ . '/../Fixtures/PluginDirInstalled/test-plugin';

View File

@@ -11,6 +11,26 @@ use Alchemy\Phrasea\Plugin\Schema\PluginValidator;
*/
class PluginManagerTest extends PluginTestCase
{
private $bkp;
public function setUp()
{
parent::setUp();
$this->bkp = self::$DI['app']['conf']->get('plugins');
}
public function tearDown()
{
if(is_null($this->bkp)) {
self::$DI['app']['conf']->remove('plugins');
}
else {
self::$DI['app']['conf']->set('plugins', $this->bkp);
}
parent::tearDown();
}
public function testListGoodPlugins()
{
$prevPlugins = self::$DI['cli']['conf']->get('plugins');