Browse Source

lancement des tests plus robuste

pull/4414/head
Cerdic 1 year ago
parent
commit
eb1a4b384a
  1. 15
      tests/01_initialiser_archives.php
  2. 15
      tests/02_informer_archives.php
  3. 15
      tests/03_deballer_archives.php
  4. 15
      tests/04_emballer_archives.php
  5. 15
      tests/05_retirer_archives.php

15
tests/01_initialiser_archives.php

@ -8,11 +8,18 @@
use Spip\Archives\SpipArchives;
$test = 'initialiser archives';
$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';
$ok = true;
require __DIR__ . '/TestCase.inc';

15
tests/02_informer_archives.php

@ -8,11 +8,18 @@
use Spip\Archives\SpipArchives;
$test = 'informer archives';
$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';
$ok = true;
require __DIR__ . '/TestCase.inc';

15
tests/03_deballer_archives.php

@ -8,11 +8,18 @@
use Spip\Archives\SpipArchives;
$test = 'deballer archives';
$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';
$ok = true;
require __DIR__ . '/TestCase.inc';

15
tests/04_emballer_archives.php

@ -8,11 +8,18 @@
use Spip\Archives\SpipArchives;
$test = 'emballer archives';
$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';
$ok = true;
require __DIR__ . '/TestCase.inc';

15
tests/05_retirer_archives.php

@ -8,11 +8,18 @@
use Spip\Archives\SpipArchives;
$test = 'retirer archives';
$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';
$ok = true;
require __DIR__ . '/TestCase.inc';

Loading…
Cancel
Save