Skip to content
Extraits de code Groupes Projets
Valider 0ca0e008 rédigé par marcimat's avatar marcimat Validation de marcimat
Parcourir les fichiers

tests: Suppressions vieux tests sur balise inclure car déjà traités en PHPUnit

parent 3c990572
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -20,13 +20,13 @@ class InclureTest extends SquelettesTestCase
$this->assertEqualsCode(
'Hello WorldHello World',
'<INCLURE{fond=' . $dir . '/data/texte_hello_world}>'
. '<INCLURE{fond=' . $dir . '/data/texte_hello_world}>'
. '<INCLURE{fond=' . $dir . '/data/texte_hello_world}>'
);
$this->assertEqualsCode(
'Hello WorldHello World',
'
<INCLURE{fond=' . $dir . '/data/texte_hello_world}>'
. '<INCLURE{fond=' . $dir . '/data/texte_hello_world}>'
. '<INCLURE{fond=' . $dir . '/data/texte_hello_world}>'
);
}
......
[(#REM)
la balise INCLURE avec un tableau en argument
]
#SET{test1,(#INCLURE{fond=#DOSSIER_SQUELETTE/inclus_article}{zero=1})}
#SET{test1,#GET{test1}|concat{(#INCLURE{fond=#DOSSIER_SQUELETTE/inclus_rien})}}
#SET{test1,#GET{test1}|concat{(#INCLURE{fond=#DOSSIER_SQUELETTE/inclus_article}{zero=1})}}
#SET{fonds,#ARRAY{0,#DOSSIER_SQUELETTE/inclus_article,1,#DOSSIER_SQUELETTE/inclus_rien,2,#DOSSIER_SQUELETTE/inclus_article}}
#SET{test2,(#INCLURE{fond=#GET{fonds}}{zero=1})}
[(#GET{test1}|=={#GET{test2}}|?{OK,#GET{test1}!=#GET{test2}})]
<?php ob_start();
?><INCLURE{fond=#GET{fonds}}{zero=1}><?php
$texte = ob_get_contents();
ob_end_clean();
$attendu = '[(#GET{test1}|texte_script)]';
if ($texte!==$attendu) {
echo "Erreur sur &lt;INCLURE&gt; avec un tableau pour fond : $texte ; attendu : $attendu";
}
?>
\ No newline at end of file
[(#REM)
INCLURE un fichier non existant
]
filtre:fin_inclure_manquant
#SET{toto,'toto9876543210'}
[(#GET{toto}|concat{'.html'}|find_in_path|?{le fichier [(#GET{toto})] ne doit pas exister})]
<INCLURE{fond=#GET{toto}}{env}>
<?php
declare(strict_types=1);
function fin_inclure_manquant() {
$debusquer = charger_fonction('debusquer', 'public');
$erreurs = $debusquer('', '', [
'erreurs' => 'get',
]);
if (!$erreurs && !(_request('var_mode') === 'debug' && erreur_squelette(false))) {
return "pas d'erreur declenchee";
}
$GLOBALS['tableau_des_erreurs'] = [];
return 'OK';
}
<BOUCLE_art(ARTICLES){#ENV{zero,0},1}>test:#ID_ARTICLE</BOUCLE_art>
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter