Skip to content

Commit

Permalink
Dev: Added way to restore the config php after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Dec 20, 2017
1 parent a5f5aaa commit 7dea756
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/bootstrap.php
Expand Up @@ -230,3 +230,16 @@
require_once(__DIR__ . '/DummyController.php');

define('PHP_ENV', 'test');

$configFile = __DIR__ . '/application/config/config.php';
$configBackupFile = __DIR__ . '/application/config/test-backup.config.php';

@copy($configFile, $configBackupFile);

register_shutdown_function(function(){
$configFile = __DIR__ . '/application/config/config.php';
$configBackupFile = __DIR__ . '/application/config/test-backup.config.php';

@unlink($configFile);
@rename($configBackupFile, $configFile);
});

0 comments on commit 7dea756

Please sign in to comment.