Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 14 → Rev 15

/trunk/controleurs/Test.php
124,11 → 124,22
$donnees['tests'][] = $this->testerSynonymeProparteSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeProparteExistence($noms);
*/
$donnees['tests'][] = $this->testerSynonymeDouteuxSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeMalAppliqueSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeOrthographiqueSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeOrthographiqueExistence($noms);
$donnees['tests'][] = $this->testerHybrideParent01Syntaxe($noms);
$donnees['tests'][] = $this->testerHybrideParent01Existence($noms);
$donnees['tests'][] = $this->testerHybrideParent02Syntaxe($noms);
$donnees['tests'][] = $this->testerHybrideParent02Existence($noms);
*/
//Debug::printr($this->manuel);
$this->setSortie(self::RENDU_CORPS, $this->getVue('test', $donnees));
}
135,7 → 146,172
//+--------------------------------------------------------------------------------------------------------------+//
// TESTS
private function testerHybrideParent02Existence($noms) {
$info = array('titre' => 'hybride_parent_02 -> existence',
'description' => "Si le champ hybride_parent_02 contient un nombre alors il doit correspondre à une valeur du champ ".
"num_nom.",
'resultat' => false);
// Réalisation du test
$noms_erreur = array();
foreach ($noms as $nom) {
if ($nom['hybride_parent_02'] != '') {
if (!isset($noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_02']);
}
}
}
// Analyse des résultats
if (count($noms_erreur) > 0) {
$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
$info['message']['lignes'] = $noms_erreur;
} else {
$info['resultat'] = true;
}
return $info;
}
private function testerHybrideParent02Syntaxe($noms) {
$info = array('titre' => 'hybride_parent_02 -> syntaxe',
'description' => "Le champ hybride_parent_02 contient soit :\n".
" - une valeur vide.\n".
" - un nombre",
'resultat' => false);
// Réalisation du test
$noms_erreur = array();
foreach ($noms as $nom) {
if ($nom['hybride_parent_02'] != '') {
if (!$this->verifierNombre($nom['hybride_parent_02'])) {
$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_02']);
}
}
}
// Analyse des résultats
if (count($noms_erreur) > 0) {
$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
$info['message']['lignes'] = $noms_erreur;
} else {
$info['resultat'] = true;
}
return $info;
}
private function testerHybrideParent01Existence($noms) {
$info = array('titre' => 'hybride_parent_01 -> existence',
'description' => "Si le champ hybride_parent_01 contient un nombre alors il doit correspondre à une valeur du champ ".
"num_nom.",
'resultat' => false);
// Réalisation du test
$noms_erreur = array();
foreach ($noms as $nom) {
if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
if (!isset($noms[$nom['hybride_parent_01']])) {
$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_01']);
}
}
}
// Analyse des résultats
if (count($noms_erreur) > 0) {
$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
$info['message']['lignes'] = $noms_erreur;
} else {
$info['resultat'] = true;
}
return $info;
}
private function testerHybrideParent01Syntaxe($noms) {
$info = array('titre' => 'hybride_parent_01 -> syntaxe',
'description' => "Le champ hybride_parent_01 contient soit :\n".
" - une valeur vide.\n".
" - un nombre",
'resultat' => false);
// Réalisation du test
$noms_erreur = array();
foreach ($noms as $nom) {
if ($nom['hybride_parent_01'] != '') {
if (!$this->verifierNombre($nom['hybride_parent_01'])) {
$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_01']);
}
}
}
// Analyse des résultats
if (count($noms_erreur) > 0) {
$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
$info['message']['lignes'] = $noms_erreur;
} else {
$info['resultat'] = true;
}
return $info;
}
private function testerSynonymeOrthographiqueExistence($noms) {
$info = array('titre' => 'synonyme_orthographique -> existence',
'description' => "Si le champ synonyme_orthographique contient un nombre alors il doit correspondre à une valeur du champ ".
"num_nom.",
'resultat' => false);
// Réalisation du test
$noms_erreur = array();
foreach ($noms as $nom) {
if ($nom['synonyme_orthographique'] != '') {
if (!isset($noms[$nom['synonyme_orthographique']])) {
$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
}
}
}
// Analyse des résultats
if (count($noms_erreur) > 0) {
$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
$info['message']['lignes'] = $noms_erreur;
} else {
$info['resultat'] = true;
}
return $info;
}
private function testerSynonymeOrthographiqueSyntaxe($noms) {
$info = array('titre' => 'synonyme_orthographique -> syntaxe',
'description' => "Le champ synonyme_orthographique contient soit :\n".
" - une valeur vide.\n".
" - un nombre",
'resultat' => false);
// Réalisation du test
$noms_erreur = array();
foreach ($noms as $nom) {
if ($nom['synonyme_orthographique'] != '') {
if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
}
}
}
// Analyse des résultats
if (count($noms_erreur) > 0) {
$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
$info['message']['lignes'] = $noms_erreur;
} else {
$info['resultat'] = true;
}
return $info;
}
private function testerSynonymeMalAppliqueSyntaxe($noms) {
$info = array('titre' => 'synonyme_mal_applique -> syntaxe',
'description' => "Le champ synonyme_mal_applique contient soit :\n".