test: make dons-sync tests work without dons.php instance copy
Déploiement PROD / check (push) Successful in 3m27s
Déploiement PROD / deploy (push) Successful in 9s

This commit is contained in:
2026-07-27 22:11:10 +04:00
parent 745726dad7
commit 297f4a276a
+14 -1
View File
@@ -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);
}