Server : Apache System : Linux webd348.cluster026.gra.hosting.ovh.net 5.15.148-ovh-vps-grsec-zfs-classid #1 SMP Thu Feb 8 09:41:04 UTC 2024 x86_64 User : hednacluml ( 122243) PHP Version : 8.3.9 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/hednacluml/info/plugins/auto/saisies/tests/saisies_manipuler/ |
<?php /** * Test unitaire de la fonction saisies_mapper_option, avec heritage * du fichier ../plugins/saisies/inc/saisies_manipuler.php * */ $test = 'saisies_mapper_option'; $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()); } find_in_path("inc/saisies.php",'',true); // chercher la fonction si elle n'existe pas function tester_saisies_mapper_option($saisies, $option, $callback) { if (!function_exists($f='saisies_mapper_option')){ find_in_path("inc/filtres.php",'',true); $f = chercher_filtre($f); } return saisies_supprimer_identifiants($f($saisies, $option, $callback)); } $g = 'tester_saisies_mapper_option'; $err = tester_fun($g, essais_saisies_mapper_option()); // si le tableau $err est pas vide ca va pas if ($err) { die ('<dl>' . join('', $err) . '</dl>'); } echo "OK"; function essais_saisies_mapper_option(){ $essais = array ( array( 0 => array ( 0 => array ( 'saisie' => 'choix_grille_1', 'options' => array ( 'nom' => 'choix_grille_1', 'data_rows' => ['a' => 'a', 'b' => 'b'], 'data_cols' => ['a' => 'a', 'b' => 'b'] ) ), ), 1 => array ( 0 => array ( 'saisie' => 'choix_grille_1', 'options' => array ( 'nom' => 'choix_grille_1', 'data_rows' => 'a|a b|b', 'data_cols' => 'a|a b|b', ) ) ), 2 => ['data_cols', 'data_rows'], 3 => 'saisies_chaine2tableau', ), ); return $essais; } ?>