34include_once(
"../include/constant.php");
35include_once(
"lib/ac_common.php");
41define (
'TEST_UNIT',1);
44if ( ini_get(
'zend.assertions') != 1 ) {
45 echo_warning(
_(
'Attention zend.assertions devrait être activé'));
46 echo
p(
'Il faut changer dans votre fichier .htaccess ou php.ini');
47 echo
'voir <a href="https://www.php.net/manual/fr/ini.core.php#ini.zend.assertions">https://www.php.net/manual/fr/ini.core.php#ini.zend.assertions</a>';
52 echo
" Vous devez donner le dossier avec paramètre gDossier dans l'url, exemple http://localhost/noalyss/html/test.php?gDossier=25";
57$cn=Dossier::connect();
62if (!file_exists(
'authorized_debug'))
64 echo
"Pour pouvoir utiliser ce fichier vous devez creer un fichier nomme authorized_debug
65 dans le repertoire html du server";
100 $card_count=
$cn->get_array(
"select count(*),f_id ".
103 " f_id is not null ".
104 "group by f_id order by count(*) desc");
105 return $card_count[0][
'f_id'];
114 $maxscan=count($scan);
115 $cnt_scenario=0;$scenario=array();
117 for ($e_scan=0; $e_scan<$maxscan; $e_scan++)
119 if (is_file(
"{$directory}/".$scan[$e_scan])&&strpos($scan[$e_scan],
'.php')==
true)
122 $a_description=file(
"{$directory}/".$scan[$e_scan]);
123 $max_description=count($a_description);
124 for (
$w=0;
$w<$max_description;
$w++)
126 if (strpos($a_description[
$w],
'@description:')==
true)
132 $scenario[$cnt_scenario][
'file']=
"{$directory}/".$scan[$e_scan];
146 $get=
'test.php?'.http_build_query(array(
'script'=>
"all",
'gDossier'=>
$gDossierLogInput,
'description'=>
"Tous les scripts",
'module'=>
$title));
148 echo
'<table style="collapse: false;border-spacing: 1rem">';
151 echo
'<a href="'.$get.
'" target="_blank">';
152 echo
"Tous les tests du module $title ";
156 echo
'<a href="'.$get.
'" target="_blank">';
157 echo
'Tous les scripts';
161 $nb_html=count($aHtml_files);
162 for (
$e=0;
$e<$nb_html;
$e++)
165 $get=
'test.php?'.http_build_query(array(
'script'=>$aHtml_files[
$e][
'file'],
'gDossier'=>
$gDossierLogInput,
'description'=>$aHtml_files[
$e][
'desc']));
171 echo
'<a href="'.$get.
'" target="_blank">';
172 echo basename($aHtml_files[
$e][
'file']);
175 echo
'<td>'.$aHtml_files[
$e][
'desc'].
'</td>';
185$min=
$cn->get_value(
"select p_id from parm_periode order by p_start asc limit 1");
186$max=
$cn->get_value(
"select p_id from parm_periode order by p_start desc limit 1");
187printf (
"Max période %s Min période %s",
$max,
$min);
191 echo
"<h1>Test NOALYSS</h1>";
197 $get=
'test.php?'.http_build_query(array(
'script'=>
"all",
'gDossier'=>
$gDossierLogInput,
'description'=>
"Tous les scripts"));
198 print '<p class="alert-primary p-2 w-50">';
199 printf(
'<a href="%s" target="_blank"> Tous les test </a>',$get);
211 $nb=
$http->get(
'nb_script',
"number",1);
213 $start_mem=memory_get_usage();
220 $scenario = array_merge($html_files, $scenario);
227 $maxscan=
$http->get(
'nb_script',
"number",count($scenario)-1);
230 echo
'<h1>'.$nb.
" ".$scenario[
$nb][
'file'].
"</h1>";
231 echo
'<h2> description = '.$scenario[
$nb][
"desc"].
'</h2>';
232 include $scenario[
$nb][
'file'];
238 echo
"<p>start mem : ".$start_mem;
240 echo
"<p>end mem : ".$end_mem;
242 echo
"<p>Diff = ".($end_mem-$start_mem).
" bytes ";
243 echo
"<p>Diff = ".(round((
$end_mem-$start_mem)/1024, 2)).
" kbytes ";
244 echo
"<p>Diff = ".(round((
$end_mem-$start_mem)/1024/1024, 2)).
" Mbytes ";
246 echo
"<p>Execution script ".$script.
" time = ".(round((
$end_time-
$start_time), 4)).
" secondes</p>";
248 if (
$nb == $maxscan ) {
251 $get=
'test.php?'.http_build_query(array(
'script'=>
"all",
'gDossier'=>
$gDossierLogInput,
'nb_script'=>
$nb));
252 echo
'<a href="'.$get.
'" target="_blank">';
253 echo $scenario[
$nb][
'file'];
260 $start_mem=memory_get_usage();
263 echo
'<h1>'.$script.
"</h1>";
264 echo
'<p> description = '.$description.
'<p>';
270 echo
"<p>start mem : ".$start_mem;
272 echo
"<p>end mem : ".$end_mem;
274 echo
"<p>Diff = ".($end_mem-$start_mem).
" bytes ";
275 echo
"<p>Diff = ".(round((
$end_mem-$start_mem)/1024, 2)).
" kbytes ";
276 echo
"<p>Diff = ".(round((
$end_mem-$start_mem)/1024/1024, 2)).
" Mbytes ";
278 echo
"<p>Execution script ".$script.
" time = ".(round((
$end_time-
$start_time), 4)).
" secondes</p>";
html_page_start($p_theme="", $p_script="", $p_script2="")
Default page header for each page.
echo_warning($p_string)
warns
p($p_string, $p_extra='')
h1($p_string, $p_class="")
noalyss_str_replace($search, $replace, $string)
global $g_user
if no group available , then stop
if($gDossier==-1) $gDossierLogInput
foreach($array as $idx=> $m) $w
_("actif, passif,charge,...")
Class to manage the company parameter (address, name...)
for($e=0; $e< count($afiche); $e++) exit
load_all_script()
load all the javascript only one time
foreach(array('magic_quotes_gpc', 'magic_quotes_runtime') as $a) $module
if( $delta< 0) elseif( $delta==0)
retrieve_files($directory)
get_card_with_activity()
Return the card this most activities.
display_test($title, $gDossierLogInput, $aHtml_files)