diff --git a/tests/php/dons-sync-test.php b/tests/php/dons-sync-test.php index 72672bc..efc04fd 100644 --- a/tests/php/dons-sync-test.php +++ b/tests/php/dons-sync-test.php @@ -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); +}