Browse Source

lancement des tests plus robuste

pull/4837/head
Cerdic 5 months ago
parent
commit
76d11dca10
  1. 15
      tests/simpletest/lanceur_spip.php
  2. 2
      tests/simpletest/nettoyer_raccourcis_typo.php
  3. 15
      tests/tw_propre.php
  4. 16
      tests/tw_propre_modeles_block.php
  5. 15
      tests/tw_propre_modeles_inline.php
  6. 16
      tests/tw_propre_typo.php

15
tests/simpletest/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();

2
tests/simpletest/nettoyer_raccourcis_typo.php

@ -1,6 +1,6 @@
<?php
require_once('lanceur_spip.php');
require_once(__DIR__ . '/lanceur_spip.php');
class Test_nettoyer_raccourcis_typo extends SpipTest {

15
tests/tw_propre.php

@ -5,11 +5,18 @@
*/
$test = 'tw_propre';
$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';
find_in_path("inc/texte.php", '', true);
$GLOBALS['spip_lang'] = 'en'; // corrections typo

16
tests/tw_propre_modeles_block.php

@ -5,11 +5,19 @@
*/
$test = 'tw_propre_modeles_block';
$remonte = "../";
while (!is_dir($remonte . "ecrire")) {
$remonte = "../$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';
find_in_path("inc/texte.php", '', true);
$GLOBALS['spip_lang'] = 'en'; // corrections typo

15
tests/tw_propre_modeles_inline.php

@ -5,11 +5,18 @@
*/
$test = 'tw_propre_modeles_inline';
$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';
find_in_path("inc/texte.php", '', true);
$GLOBALS['spip_lang'] = 'en'; // corrections typo

16
tests/tw_propre_typo.php

@ -5,11 +5,19 @@
*/
$test = 'tw_propre_typo';
$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';
find_in_path("inc/texte.php", '', true);
$GLOBALS['spip_lang'] = 'fr'; // corrections typo

Loading…
Cancel
Save