test: make dons-sync tests work without dons.php instance copy
This commit is contained in:
@@ -14,7 +14,16 @@ $root = dirname(__DIR__, 2);
|
||||
|
||||
// --- Synchronisation dons.php / dons.php.sample -----------------------------
|
||||
|
||||
$donsLive = file_get_contents($root . '/dons.php');
|
||||
// dons.php est une copie d'instance ignorée par git : dans le CI elle est
|
||||
// absente, on la crée depuis le .sample pour les tests et on la nettoie après.
|
||||
$donsLivePath = $root . '/dons.php';
|
||||
$donsLiveCreated = false;
|
||||
if (!file_exists($donsLivePath)) {
|
||||
copy($root . '/dons.php.sample', $donsLivePath);
|
||||
$donsLiveCreated = true;
|
||||
}
|
||||
|
||||
$donsLive = file_get_contents($donsLivePath);
|
||||
$donsSample = file_get_contents($root . '/dons.php.sample');
|
||||
|
||||
assertContains(
|
||||
@@ -206,3 +215,7 @@ foreach ($phpErrorNeedles as $needle) {
|
||||
foreach ($createdCopies as $copyPath) {
|
||||
unlink($copyPath);
|
||||
}
|
||||
|
||||
if ($donsLiveCreated) {
|
||||
unlink($donsLivePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user