diff --git a/tests/barre_outil_markitup.php b/tests/barre_outil_markitup.php index f856e73..f9b62f3 100644 --- a/tests/barre_outil_markitup.php +++ b/tests/barre_outil_markitup.php @@ -4,7 +4,7 @@ * Licence GPL * Auteur Matthieu Marcillaud */ -require_once('lanceur_spip.php'); +require_once(__DIR__ . '/lanceur_spip.php'); class Test_barre_outil_markitup extends SpipTest { diff --git a/tests/lanceur_spip.php b/tests/lanceur_spip.php index 30c88c7..48b5e78 100644 --- a/tests/lanceur_spip.php +++ b/tests/lanceur_spip.php @@ -3,10 +3,17 @@ * Démarre SPIP afin d'obtenir ses fonctions depuis * les jeux de tests unitaires de type simpletest */ -$remonte = '../'; -while (!is_dir($remonte . 'ecrire')) { - $remonte = "../$remonte"; +$remonte = ""; +while (!is_file($remonte."test.inc") and !is_dir($remonte.'ecrire/')) + $remonte = $remonte."../"; +foreach ([$remonte."test.inc", $remonte."tests/test.inc", $remonte."tests/tests/legacy/test.inc"] as $f) { + if (is_file($f)){ + require $f; + break; + } +} +if (!defined('_SPIP_TEST_INC')) { + die('Impossible de trouver test.inc depuis ' .getcwd()); } -require $remonte . 'tests/test.inc'; demarrer_simpletest();