Subversion Repositories Applications.referentiel

Rev

Rev 175 | Rev 177 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 175 Rev 176
1
<?php
1
<?php
2
// Encodage : UTF-8
2
// Encodage : UTF-8
3
// +-------------------------------------------------------------------------------------------------------------------+
3
// +-------------------------------------------------------------------------------------------------------------------+
4
/**
4
/**
5
* Tests de référentiels de nomenclature et taxonomie
5
* Tests de référentiels de nomenclature et taxonomie
6
*
6
*
7
* Description : classe permettant de tester les référentiels selon le manuel technique
7
* Description : classe permettant de tester les référentiels selon le manuel technique
8
* Utilisation : php script.php tests -p bdnff -a tout
8
* Utilisation : php script.php tests -p bdnff -a tout
9
*
9
*
10
//Auteur original :
10
//Auteur original :
11
* @author       Jean-Pascal MILCENT <jpm@tela-botanica.org>
11
* @author       Jean-Pascal MILCENT <jpm@tela-botanica.org>
12
* @copyright	Tela-Botanica 1999-2010
12
* @copyright	Tela-Botanica 1999-2010
13
* @link			http://www.tela-botanica.org/wikini/RTaxMethodo/wakka.php?wiki=MaNuel
13
* @link			http://www.tela-botanica.org/wikini/RTaxMethodo/wakka.php?wiki=MaNuel
14
* @licence		GPL v3 & CeCILL v2
14
* @licence		GPL v3 & CeCILL v2
15
* @version		$Id$
15
* @version		$Id$
16
*/
16
*/
17
// +-------------------------------------------------------------------------------------------------------------------+
17
// +-------------------------------------------------------------------------------------------------------------------+
18
// TODO : supprimer l'utilisation du paramêtres 'p' et chercher les infos depuis la bdd
18
// TODO : supprimer l'utilisation du paramêtres 'p' et chercher les infos depuis la bdd
19
class Tests extends ScriptCommande {
19
class Tests extends ScriptCommande {
20
	
20
	
21
	const SCRIPT_NOM = 'tests';
21
	const SCRIPT_NOM = 'tests';
22
	
22
	
23
	private $projet = null;
23
	private $projet = null;
24
	private $traitement = null;
24
	private $traitement = null;
25
	
25
	
26
	private $manuel = null;
26
	private $manuel = null;
27
	private $tests = null;
27
	private $tests = null;
28
	private $colonnes = null;
28
	private $colonnes = null;
29
	private $analyses = null;
29
	private $analyses = null;
30
	private $noms = null;
30
	private $noms = null;
31
	
31
	
32
	private $resultatDao = null;
32
	private $resultatDao = null;
33
	private $traitementDao = null;
33
	private $traitementDao = null;
34
	private $tableStructureDao = null;
34
	private $tableStructureDao = null;
35
	private $referentielDao = null;
35
	private $referentielDao = null;
36
	
36
	
37
	public function executer() {
37
	public function executer() {
38
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v4.1.ini');
38
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v4.1.ini');
-
 
39
		$this->definirConstantes();
39
		$this->tests = parse_ini_file($this->getModuleChemin().DS.'configurations'.DS.'tests.ini', true);
40
		$this->tests = parse_ini_file($this->getModuleChemin().DS.'configurations'.DS.'tests.ini', true);
40
		
41
		
41
		$this->resultatDao = new ResultatDao();
42
		$this->resultatDao = new ResultatDao();
42
		$this->traitementDao = new TraitementDao();
43
		$this->traitementDao = new TraitementDao();
43
		Debug::printr('Dans le script test');
44
		Debug::printr('Dans le script test');
44
		// Récupération du dernier traitement demandé
45
		// Récupération du dernier traitement demandé
45
		$this->traitement = $this->traitementDao->getDernierTraitement('tout', self::SCRIPT_NOM);
46
		$this->traitement = $this->traitementDao->getDernierTraitement('tout', self::SCRIPT_NOM);
46
		if (isset($this->traitement)) {
47
		if (isset($this->traitement)) {
47
			$this->projet = $this->traitement['referentiel_code']; // Récupération du nom de projet
48
			$this->projet = $this->traitement['referentiel_code']; // Récupération du nom de projet
48
			Debug::printr($this->traitement);
49
			Debug::printr($this->traitement);
49
			// Écriture de la date de début du traitement
50
			// Écriture de la date de début du traitement
50
			Debug::printr('Debute:'.$this->traitementDao->debuterTraitement($this->traitement['id_traitement']));
51
			Debug::printr('Debute:'.$this->traitementDao->debuterTraitement($this->traitement['id_traitement']));
51
			
52
			
52
			// Nettoyage des traitements obsolètes
53
			// Nettoyage des traitements obsolètes
53
			$traitements_obsoletes = $this->traitementDao->getTraitementsObsoletes($this->projet, self::SCRIPT_NOM);
54
			$traitements_obsoletes = $this->traitementDao->getTraitementsObsoletes($this->projet, self::SCRIPT_NOM);
54
			if (isset($traitements_obsoletes)) {
55
			if (isset($traitements_obsoletes)) {
55
				Debug::printr('Supp. obsoletes:'.$this->traitementDao->supprimer($traitements_obsoletes));
56
				Debug::printr('Supp. obsoletes:'.$this->traitementDao->supprimer($traitements_obsoletes));
56
			}
57
			}
57
			
58
			
58
			$this->tableStructureDao = new TableStructureDao();
59
			$this->tableStructureDao = new TableStructureDao();
59
			$this->referentielDao = new ReferentielDao();
60
			$this->referentielDao = new ReferentielDao();
60
			
61
			
61
			// Lancement du test demandé
62
			// Lancement du test demandé
62
			$cmd = $this->getParam('a');
63
			$cmd = $this->getParam('a');
63
	    	switch ($cmd) {
64
	    	switch ($cmd) {
64
				case 'tout' :
65
				case 'tout' :
65
					Debug::printr('Départ lancement test:');
66
					Debug::printr('Départ lancement test:');
66
					$this->recupererDonnees();
67
					$this->recupererDonnees();
67
					$this->lancerTests();
68
					$this->lancerTests();
68
					break;
69
					break;
69
				case 'test11' :
70
				case 'test11' :
70
					$this->recupererDonnees();
71
					$this->recupererDonnees();
71
					Debug::printr('Départ lancement test 11 :');
72
					Debug::printr('Départ lancement test 11 :');
72
					$this->testerClassificationRang();
73
					$this->testerClassificationRang();
73
					break;
74
					break;
74
				default :
75
				default :
75
					$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
76
					$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
76
			}
77
			}
77
			// Écriture de la date de fin du traitement
78
			// Écriture de la date de fin du traitement
78
			Debug::printr('Termine:'.$this->traitementDao->terminerTraitement($this->traitement['id_traitement']));
79
			Debug::printr('Termine:'.$this->traitementDao->terminerTraitement($this->traitement['id_traitement']));
79
		} else {
80
		} else {
80
			Debug::printr("Aucun dernier traitement trouvé pour le script '".self::SCRIPT_NOM."' !");
81
			Debug::printr("Aucun dernier traitement trouvé pour le script '".self::SCRIPT_NOM."' !");
81
		}
82
		}
82
    }
83
    }
-
 
84
    
-
 
85
    /**
-
 
86
     * Cette méthode définie des constantes qui peuvent ensuite être utilisée dans les fichier ini.
-
 
87
     * Surtout utile pour le fichier tests.ini
-
 
88
     */
-
 
89
    private function definirConstantes() {
-
 
90
    	define('RANG_GENRE', $this->manuel['rang_genre']);
-
 
91
    	define('RANG_SP', $this->manuel['rang_sp']);
-
 
92
    }
83
    
93
    
84
    public function recupererDonnees() {
94
    public function recupererDonnees() {
85
		// Récupération des données à tester
95
		// Récupération des données à tester
86
		$this->colonnes = $this->tableStructureDao->getColonnes($this->projet);
96
		$this->colonnes = $this->tableStructureDao->getColonnes($this->projet);
87
		$this->analyses = $this->tableStructureDao->getAnalyse($this->projet);
97
		$this->analyses = $this->tableStructureDao->getAnalyse($this->projet);
88
		$this->noms = $this->referentielDao->getTout($this->projet);
98
		$this->noms = $this->referentielDao->getTout($this->projet);
89
		Debug::printr('Nbre noms :'.count($this->noms));
99
		Debug::printr('Nbre noms :'.count($this->noms));
90
    }
100
    }
91
    
101
    
92
    public function lancerTestsAuto() {
102
    public function lancerTestsAuto() {
93
		$resultats = array();
103
		$resultats = array();
94
 
104
 
95
		// Lancement des tests unitaires
105
		// Lancement des tests unitaires
96
    	foreach (array_keys($this->tests) as $numero) {
106
    	foreach (array_keys($this->tests) as $numero) {
97
			$info = $this->getInfosTest($numero);
107
			$info = $this->getInfosTest($numero);
98
    		
108
    		
99
    		if ($numero < 5) {
109
    		if ($numero < 5) {
100
    			// Tests spéciaux vérifiant la structure de la table
110
    			// Tests spéciaux vérifiant la structure de la table
101
    			$resultats[] = $this->lancerTestUnitaire($info);
111
    			$resultats[] = $this->lancerTestUnitaire($info);
102
    		} else if ($numero >= 5 && $this->verifierResultats($resultats)) {		
112
    		} else if ($numero >= 5 && $this->verifierResultats($resultats)) {		
103
				// Si la structure est bonne nous lançons les autres tests
113
				// Si la structure est bonne nous lançons les autres tests
104
				
114
				
105
    		}
115
    		}
106
		}
116
		}
107
    }
117
    }
108
    
118
    
109
    public function lancerTestUnitaire($info) {
119
    public function lancerTestUnitaire($info) {
110
		$methodeDeTest = $info['methode'];
120
		$methodeDeTest = $info['methode'];
111
    	$erreurs = $this->$methodeDeTest;
121
    	$erreurs = $this->$methodeDeTest;
112
    	
122
    	
113
    	// Analyse des résultats
123
    	// Analyse des résultats
114
    	if (isset($erreurs['special'])) {
124
    	if (isset($erreurs['special'])) {
115
    		$info = $erreurs;
125
    		$info = $erreurs;
116
    	} else {
126
    	} else {
117
			if (count($erreurs) > 0) {
127
    		if (count($erreurs) > 0) {
118
				$info['message']['entete'] = explode(',', $info['entete']);
128
				$info['message']['entete'] = explode(',', $info['entete']);
119
				$info['message']['lignes'] = $erreurs;
129
				$info['message']['lignes'] = $erreurs;
-
 
130
				unset($erreurs);
120
			} else {
131
			} else {
121
				$info['resultat'] = true;
132
				$info['resultat'] = true;
122
			}
133
			}
123
    	}
134
    	}
124
    	
135
    	
125
		$this->traiterResultatTest($info);
136
		$this->traiterResultatTest($info);
126
		
137
		
127
		if ($info['numero'] < 5) {
138
		if ($info['numero'] < 5) {
128
			return ($info['resultat'] ? '1' : '0');
139
			return ($info['resultat'] ? '1' : '0');
129
		}
140
		}
130
    }
141
    }
131
    
142
    
132
    public function lancerTests() {
143
    public function lancerTests() {
133
		// Lancement des tests unitaires
144
		// Lancement des tests unitaires
134
		$resultats = array();
145
		$resultats = array();
135
		$resultats[] = $this->testerNombreDeChamps();
146
		$resultats[] = $this->testerNombreDeChamps();
136
		$resultats[] = $this->testerNomDesChamps();
147
		$resultats[] = $this->testerNomDesChamps();
137
		$resultats[] = $this->testerTypeDesChamps();
148
		$resultats[] = $this->testerTypeDesChamps();
138
		$resultats[] = $this->testerNumNomClePrimaire();
149
		$resultats[] = $this->testerNumNomClePrimaire();
139
		
150
		
140
		// Si la structure est bonne nous lançons les autres tests
151
		// Si la structure est bonne nous lançons les autres tests
141
		Debug::printr($resultats);
152
		Debug::printr($resultats);
142
		if ($this->verifierResultats($resultats)) {
153
		if ($this->verifierResultats($resultats)) {
143
			$this->testerTailleDesChamps();
154
			$this->testerTailleDesChamps();
144
			
155
			
145
			$this->testerNumNomSuperieurAZero();
156
			$this->testerNumNomSuperieurAZero();
146
			
157
			
147
			$this->testerNumNomRetenuSuperieurAZero();
158
			$this->testerNumNomRetenuSuperieurAZero();
148
			$this->testerNumTaxSupEgalZeroUnique();
159
			$this->testerNumTaxSupEgalZeroUnique();
149
			$this->testerTaxSupPourTaxon();
160
			$this->testerTaxSupPourTaxon();
150
			$this->testerExitenceTaxonSuperieur();
161
			$this->testerExitenceTaxonSuperieur();
151
			$this->testerClassificationRang();	
162
			$this->testerClassificationRang();	
152
			$this->testerClassification();
163
			$this->testerClassification();
153
			
164
			
154
			$this->testerRang();
165
			$this->testerRang();
155
			
166
			
156
			$this->testerNomCompletSupraGenerique();
167
			$this->testerNomCompletSupraGenerique();
157
			$this->testerNomCompletGenre();
168
			$this->testerNomCompletGenre();
158
			$this->testerNomCompletInfraGenre();
169
			$this->testerNomCompletInfraGenre();
159
			$this->testerNomCompletEspece();
170
			$this->testerNomCompletEspece();
160
			$this->testerNomCompletInfraSpecifique();
171
			$this->testerNomCompletInfraSpecifique();
161
	
172
	
162
			$this->testerNomSupraGeneriqueEspaces();
173
			$this->testerNomSupraGeneriqueEspaces();
163
			$this->testerNomSupraGeneriqueSyntaxe();
174
			$this->testerNomSupraGeneriqueSyntaxe();
164
			$this->testerNomSupraGeneriqueRang();
175
			$this->testerNomSupraGeneriqueRang();
165
			
176
			
166
			$this->testerGenreEspaces();
177
			$this->testerGenreEspaces();
167
			$this->testerGenreSyntaxe();
178
			$this->testerGenreSyntaxe();
168
			$this->testerGenreRang();
179
			$this->testerGenreRang();
169
			
180
			
170
			$this->testerEpitheteInfraGeneriqueEspaces();
181
			$this->testerEpitheteInfraGeneriqueEspaces();
171
			$this->testerEpitheteInfraGeneriqueSyntaxe();
182
			$this->testerEpitheteInfraGeneriqueSyntaxe();
172
			$this->testerEpitheteInfraGeneriqueRang();
183
			$this->testerEpitheteInfraGeneriqueRang();
173
			
184
			
174
			$this->testerEpitheteSpEspaces();
185
			$this->testerEpitheteSpEspaces();
175
			$this->testerEpitheteSpSyntaxe();
186
			$this->testerEpitheteSpSyntaxe();
176
			$this->testerEpitheteSpRang();
187
			$this->testerEpitheteSpRang();
177
			
188
			
178
			$this->testerTypeEpitheteEspaces();
189
			$this->testerTypeEpitheteEspaces();
179
			$this->testerTypeEpitheteSyntaxe();
190
			$this->testerTypeEpitheteSyntaxe();
180
			$this->testerTypeEpitheteHybridite();
191
			$this->testerTypeEpitheteHybridite();
181
			
192
			
182
			$this->testerEpitheteInfraSpEspaces();
193
			$this->testerEpitheteInfraSpEspaces();
183
			$this->testerEpitheteInfraSpSyntaxe();
194
			$this->testerEpitheteInfraSpSyntaxe();
184
			$this->testerEpitheteInfraSpRang();
195
			$this->testerEpitheteInfraSpRang();
185
			
196
			
186
			$this->testerGroupeCultivarSyntaxe();
197
			$this->testerGroupeCultivarSyntaxe();
187
			$this->testerGroupeCultivarRang();		
198
			$this->testerGroupeCultivarRang();		
188
			
199
			
189
			$this->testerCultivarSyntaxe();
200
			$this->testerCultivarSyntaxe();
190
			$this->testerCultivarRang();
201
			$this->testerCultivarRang();
191
			
202
			
192
			$this->testerNomCommercialSyntaxe();
203
			$this->testerNomCommercialSyntaxe();
193
			$this->testerNomCommercialPresenceCultivar();
204
			$this->testerNomCommercialPresenceCultivar();
194
			
205
			
195
			$this->testerAuteurSyntaxe();
206
			$this->testerAuteurSyntaxe();
196
			
207
			
197
			$this->testerAnneeSyntaxe();
208
			$this->testerAnneeSyntaxe();
198
			
209
			
199
			$this->testerBiblioOrigineSyntaxe();
210
			$this->testerBiblioOrigineSyntaxe();
200
			
211
			
201
			$this->testerHomonymieSyntaxe();
212
			$this->testerHomonymieSyntaxe();
202
			$this->testerHomonymieExistence();
213
			$this->testerHomonymieExistence();
203
			
214
			
204
			$this->testerBasionymeSyntaxe();
215
			$this->testerBasionymeSyntaxe();
205
			$this->testerBasionymeExistence();
216
			$this->testerBasionymeExistence();
206
			
217
			
207
			$this->testerSynonymeProparteSyntaxe();
218
			$this->testerSynonymeProparteSyntaxe();
208
			$this->testerSynonymeProparteExistence();
219
			$this->testerSynonymeProparteExistence();
209
			
220
			
210
			$this->testerSynonymeDouteuxSyntaxe();
221
			$this->testerSynonymeDouteuxSyntaxe();
211
			$this->testerSynonymeDouteuxNumNomRetenu();
222
			$this->testerSynonymeDouteuxNumNomRetenu();
212
			
223
			
213
			$this->testerSynonymeMalAppliqueSyntaxe();
224
			$this->testerSynonymeMalAppliqueSyntaxe();
214
			
225
			
215
			$this->testerSynonymeOrthographiqueSyntaxe();
226
			$this->testerSynonymeOrthographiqueSyntaxe();
216
			$this->testerSynonymeOrthographiqueExistence();
227
			$this->testerSynonymeOrthographiqueExistence();
217
			
228
			
218
			$this->testerHybrideParent01Syntaxe();
229
			$this->testerHybrideParent01Syntaxe();
219
			$this->testerHybrideParent01Existence();
230
			$this->testerHybrideParent01Existence();
220
			$this->testerHybrideParent02Syntaxe();
231
			$this->testerHybrideParent02Syntaxe();
221
			$this->testerHybrideParent02Existence();
232
			$this->testerHybrideParent02Existence();
222
			
233
			
223
			$this->testerPresenceSyntaxe();
234
			$this->testerPresenceSyntaxe();
224
			$this->testerStatutOrigineSyntaxe();
235
			$this->testerStatutOrigineSyntaxe();
225
			$this->testerStatutIntroductionSyntaxe();
236
			$this->testerStatutIntroductionSyntaxe();
226
			$this->testerStatutCultureSyntaxe();
237
			$this->testerStatutCultureSyntaxe();
227
			$this->testerExclureTaxRefSyntaxe();
238
			$this->testerExclureTaxRefSyntaxe();
228
		}
239
		}
229
	}
240
	}
230
	
241
	
231
	private function verifierResultats($resultats) {
242
	private function verifierResultats($resultats) {
232
		$ok = true;
243
		$ok = true;
233
		foreach ($resultats as $resultat) {
244
		foreach ($resultats as $resultat) {
234
			if ($resultat == '0') {
245
			if ($resultat == '0') {
235
				$ok = false;
246
				$ok = false;
236
				break;
247
				break;
237
			}
248
			}
238
		}
249
		}
239
		return $ok;
250
		return $ok;
240
	}
251
	}
241
	
252
	
242
	//+--------------------------------------------------------------------------------------------------------------+//
253
	//+--------------------------------------------------------------------------------------------------------------+//
243
	// Enregistrement des résultats
254
	// Enregistrement des résultats
244
	private function traiterResultatTest($info) {
255
	private function traiterResultatTest($info) {
245
		Debug::printr($info['nom']);
256
		Debug::printr($info['nom']);
246
		if (isset($info['message'])) {
257
		if (isset($info['message'])) {
247
			if (is_array($info['message'])) {
258
			if (is_array($info['message'])) {
248
				$info['message'] = $this->getVue('tests/squelettes/message_table', $info);
259
				$info['message'] = $this->getVue('tests/squelettes/message_table', $info);
249
			} else {
260
			} else {
250
				$info['message'] = $this->getVue('tests/squelettes/message_p', $info);
261
				$info['message'] = $this->getVue('tests/squelettes/message_p', $info);
251
			}
262
			}
252
		}
263
		}
253
		$this->resultatDao->ajouter($this->traitement['id_traitement'], $info);
264
		$this->resultatDao->ajouter($this->traitement['id_traitement'], $info);
254
		$info = null;
265
		$info = null;
255
	}
266
	}
256
	
267
	
257
	//+--------------------------------------------------------------------------------------------------------------+//
268
	//+--------------------------------------------------------------------------------------------------------------+//
258
	// TESTS
269
	// TESTS
259
	
270
	
260
	/**
271
	/**
261
	 * Test #01
272
	 * Test #01
262
	 */
273
	 */
263
	private function testerNombreDeChamps() {
274
	private function testerNombreDeChamps() {
264
		$info = $this->getInfosTest(1);
275
		$info = $this->getInfosTest(1);
265
		$info['special'] = true;
276
		$info['special'] = true;
266
		
277
		
267
		$nbre_colonnes = count($this->colonnes);
278
		$nbre_colonnes = count($this->colonnes);
268
		$info['message'] = $nbre_colonnes;
279
		$info['message'] = $nbre_colonnes;
269
		if ($nbre_colonnes >= 35) {
280
		if ($nbre_colonnes >= 35) {
270
			$info['resultat'] = true;
281
			$info['resultat'] = true;
271
		}
282
		}
272
		
283
		
273
		return $info;
284
		return $info;
274
	}
285
	}
275
	
286
	
276
	/**
287
	/**
277
	 * Test #02
288
	 * Test #02
278
	 */
289
	 */
279
	private function testerNomDesChamps() {
290
	private function testerNomDesChamps() {
280
		$info = $this->getInfosTest(2);
291
		$info = $this->getInfosTest(2);
281
		$info['special'] = true;
292
		$info['special'] = true;
282
		
293
		
283
		$champs_attendus = explode(',', $this->manuel['champs']);
294
		$champs_attendus = explode(',', $this->manuel['champs']);
284
		$champs_presents = array();
295
		$champs_presents = array();
285
		foreach ($this->colonnes as $colonne) {
296
		foreach ($this->colonnes as $colonne) {
286
			$champs_presents[$colonne['Field']] = $colonne;
297
			$champs_presents[$colonne['Field']] = $colonne;
287
		}
298
		}
288
		
299
		
289
		$ok = true;
300
		$ok = true;
290
		$champs_manquant = array(); 
301
		$champs_manquant = array(); 
291
		foreach ($champs_attendus as $champ_attendu) {
302
		foreach ($champs_attendus as $champ_attendu) {
292
			if (!isset($champs_presents[$champ_attendu])) {
303
			if (!isset($champs_presents[$champ_attendu])) {
293
				$champs_manquant[] = $champ_attendu; 
304
				$champs_manquant[] = $champ_attendu; 
294
				$ok = false;
305
				$ok = false;
295
			}
306
			}
296
		}
307
		}
297
		
308
		
298
		$info['resultat'] = $ok;
309
		$info['resultat'] = $ok;
299
		if (!$ok) {
310
		if (!$ok) {
300
			$info['message'] = sprintf($info['message'], implode(', ', $champs_manquant));
311
			$info['message'] = sprintf($info['message'], implode(', ', $champs_manquant));
301
		}
312
		}
302
		
313
		
303
		return $info;
314
		return $info;
304
	}
315
	}
305
	
316
	
306
	/**
317
	/**
307
	 * Test #03
318
	 * Test #03
308
	 */
319
	 */
309
	private function testerTypeDesChamps() {
320
	private function testerTypeDesChamps() {
310
		$champs_attendus = explode(',', $this->manuel['champs_type']);
321
		$champs_attendus = explode(',', $this->manuel['champs_type']);
311
		$champs_presents = array();
322
		$champs_presents = array();
312
		foreach ($this->colonnes as $colonne) {
323
		foreach ($this->colonnes as $colonne) {
313
			$champs_presents[$colonne['Field']] = $colonne['Type'];
324
			$champs_presents[$colonne['Field']] = $colonne['Type'];
314
		}
325
		}
315
		
326
		
316
		// Recercherche des erreurs
327
		// Recercherche des erreurs
317
		$champs_erreur = array(); 
328
		$champs_erreur = array(); 
318
		foreach ($champs_attendus as $champ_attendu) {
329
		foreach ($champs_attendus as $champ_attendu) {
319
			list($champ_attendu_nom, $champ_attendu_type_taille) = explode('=', trim($champ_attendu));
330
			list($champ_attendu_nom, $champ_attendu_type_taille) = explode('=', trim($champ_attendu));
320
			list($champ_attendu_type, $champ_attendu_taille) = explode('|', trim($champ_attendu_type_taille));
331
			list($champ_attendu_type, $champ_attendu_taille) = explode('|', trim($champ_attendu_type_taille));
321
			
332
			
322
			if (isset($champs_presents[$champ_attendu_nom])) {
333
			if (isset($champs_presents[$champ_attendu_nom])) {
323
				$champs_present_type = $champs_presents[$champ_attendu_nom];
334
				$champs_present_type = $champs_presents[$champ_attendu_nom];
324
				
335
				
325
				if (($champ_attendu_type == 'VARCHAR' && strstr($champs_present_type, 'varchar') === false)
336
				if (($champ_attendu_type == 'VARCHAR' && strstr($champs_present_type, 'varchar') === false)
326
					|| ($champ_attendu_type == 'TEXT' && strstr($champs_present_type, 'text') === false)
337
					|| ($champ_attendu_type == 'TEXT' && strstr($champs_present_type, 'text') === false)
327
					|| ($champ_attendu_type == 'INT' && strstr($champs_present_type, 'int') === false) 
338
					|| ($champ_attendu_type == 'INT' && strstr($champs_present_type, 'int') === false) 
328
					|| ($champ_attendu_type == 'BOOL' && preg_match('/(?:bool|boolean|tinyint\(1\))/i', $champs_present_type) === false)) {
339
					|| ($champ_attendu_type == 'BOOL' && preg_match('/(?:bool|boolean|tinyint\(1\))/i', $champs_present_type) === false)) {
329
					$champs_erreur[] = array($champ_attendu, $champ_attendu_type, $champs_present_type);
340
					$champs_erreur[] = array($champ_attendu, $champ_attendu_type, $champs_present_type);
330
				}
341
				}
331
			}
342
			}
332
		}
343
		}
333
		return $champs_erreur;
344
		return $champs_erreur;
334
	}
345
	}
335
	
346
	
336
	/**
347
	/**
337
	 * Test #04
348
	 * Test #04
338
	 */
349
	 */
339
	private function testerNumNomClePrimaire() {
350
	private function testerNumNomClePrimaire() {
340
		$info = $this->getInfosTest(4);
351
		$info = $this->getInfosTest(4);
341
		$info['special'] = true;
352
		$info['special'] = true;
342
		
353
		
343
		foreach ($this->colonnes as $colonne) {
354
		foreach ($this->colonnes as $colonne) {
344
			if ($colonne['Field'] == 'num_nom' && $colonne['Key'] == 'PRI') {
355
			if ($colonne['Field'] == 'num_nom' && $colonne['Key'] == 'PRI') {
345
				$info['resultat'] = true;
356
				$info['resultat'] = true;
346
			}
357
			}
347
		}
358
		}
348
		return $info;
359
		return $info;
349
	}
360
	}
350
	
361
	
351
	
362
	
352
	/**
363
	/**
353
	 * Test #05
364
	 * Test #05
354
	 */
365
	 */
355
	private function testerTailleDesChamps() {
366
	private function testerTailleDesChamps() {
356
		$tailles_champs_maxi = array();
367
		$tailles_champs_maxi = array();
357
		foreach ($this->colonnes as $colonne) {
368
		foreach ($this->colonnes as $colonne) {
358
			if (preg_match('/^varchar\(([0-9]+)\)$/', $colonne['Type'], $match)) {
369
			if (preg_match('/^varchar\(([0-9]+)\)$/', $colonne['Type'], $match)) {
359
				$tailles_champs_maxi[$colonne['Field']] = $match[1];
370
				$tailles_champs_maxi[$colonne['Field']] = $match[1];
360
			}
371
			}
361
		}
372
		}
362
		
373
		
363
		$tailles_trouvees = array();
374
		$tailles_trouvees = array();
364
		foreach ($this->analyses as $analyse) {
375
		foreach ($this->analyses as $analyse) {
365
			if (preg_match('/\.([^.]+)$/', $analyse['Field_name'], $match)) {
376
			if (preg_match('/\.([^.]+)$/', $analyse['Field_name'], $match)) {
366
				$tailles_trouvees[$match[1]] = $analyse['Max_length'];
377
				$tailles_trouvees[$match[1]] = $analyse['Max_length'];
367
			}
378
			}
368
		}
379
		}
369
		
380
		
370
		$champs_erreur = array();
381
		$champs_erreur = array();
371
		$champs_attendus = explode(',', $this->manuel['champs']);
382
		$champs_attendus = explode(',', $this->manuel['champs']);
372
		foreach ($champs_attendus as $champ_attendu) {
383
		foreach ($champs_attendus as $champ_attendu) {
373
			if (isset($tailles_champs_maxi[$champ_attendu]) && isset($tailles_trouvees[$champ_attendu])) {
384
			if (isset($tailles_champs_maxi[$champ_attendu]) && isset($tailles_trouvees[$champ_attendu])) {
374
				if ($tailles_champs_maxi[$champ_attendu] == $tailles_trouvees[$champ_attendu]) {
385
				if ($tailles_champs_maxi[$champ_attendu] == $tailles_trouvees[$champ_attendu]) {
375
					$champs_erreur[] = array($champ_attendu, $tailles_champs_maxi[$champ_attendu], $tailles_trouvees[$champ_attendu]);
386
					$champs_erreur[] = array($champ_attendu, $tailles_champs_maxi[$champ_attendu], $tailles_trouvees[$champ_attendu]);
376
				}
387
				}
377
			}
388
			}
378
		}
389
		}
379
		return $champs_erreur;
390
		return $champs_erreur;
380
	}
391
	}
381
		
392
		
382
	/**
393
	/**
383
	 * Test #06
394
	 * Test #06
384
	 */
395
	 */
385
	private function testerNumNomSuperieurAZero() {
396
	private function testerNumNomSuperieurAZero() {
386
		// Réalisation du test
397
		// Réalisation du test
387
		$noms_erreur = array();
398
		$noms_erreur = array();
388
		foreach ($this->noms as &$nom) {
399
		foreach ($this->noms as &$nom) {
389
			if ($nom['num_nom'] <= 0) {
400
			if ($nom['num_nom'] <= 0) {
390
				$noms_erreur[] = array($nom['num_nom']);
401
				$noms_erreur[] = array($nom['num_nom']);
391
			}
402
			}
392
		}
403
		}
393
		return $noms_erreur;
404
		return $noms_erreur;
394
	}
405
	}
395
	
406
	
396
	/**
407
	/**
397
	 * Test #07
408
	 * Test #07
398
	 */
409
	 */
399
	private function testerNumNomRetenuSuperieurAZero() {
410
	private function testerNumNomRetenuSuperieurAZero() {
400
		$info = $this->getInfosTest(7);
-
 
401
		
-
 
402
		// Réalisation du test
411
		// Réalisation du test
403
		$noms_erreur = array();
412
		$noms_erreur = array();
404
		foreach ($this->noms as &$nom) {
413
		foreach ($this->noms as &$nom) {
405
			if ($nom['num_nom_retenu'] != '' && $nom['num_nom_retenu'] <= 0) {
414
			if ($nom['num_nom_retenu'] != '' && $nom['num_nom_retenu'] <= 0) {
406
				$noms_erreur[] = array($nom['num_nom'], $nom['num_nom_retenu']);
415
				$noms_erreur[] = array($nom['num_nom'], $nom['num_nom_retenu']);
407
			}
416
			}
408
		}
417
		}
409
		
-
 
410
		// Analyse des résultats
-
 
411
		if (count($noms_erreur) > 0) {
418
		return $noms_erreur;
412
			$info['message']['entete'] = array('num_nom', 'num_nom_retenu');
-
 
413
			$info['message']['lignes'] = $noms_erreur;
-
 
414
		} else {
-
 
415
			$info['resultat'] = true;
-
 
416
		}
-
 
417
		
-
 
418
		$this->traiterResultatTest($info);
-
 
419
	}
419
	}
420
	
420
	
421
	/**
421
	/**
422
	 * Test #08
422
	 * Test #08
423
	 */
423
	 */
424
	private function testerNumTaxSupEgalZeroUnique() {
424
	private function testerNumTaxSupEgalZeroUnique() {
425
		$info = $this->getInfosTest(8);
-
 
426
		
-
 
427
		// Réalisation du test
425
		// Réalisation du test
428
		$noms_erreur = array();
426
		$noms_erreur = array();
429
		foreach ($this->noms as &$nom) {
427
		foreach ($this->noms as &$nom) {
430
			if (preg_match('/^0$/', $nom['num_tax_sup'])) {
428
			if (preg_match('/^0$/', $nom['num_tax_sup'])) {
431
				$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']);
429
				$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']);
432
			}
430
			}
433
		}
431
		}
434
		
-
 
435
		// Analyse des résultats
432
		// Ce test est spécial car le nombre de noms en erreurs doit être supérieur à 1 et non à 0 pour être KO.
436
		if (count($noms_erreur) > 1) {
433
		if (count($noms_erreur) == 1) {
437
			$info['message']['entete'] = array('num_nom', 'num_tax_sup');
-
 
438
			$info['message']['lignes'] = $noms_erreur;
-
 
439
		} else {
-
 
440
			$info['resultat'] = true;
434
			$noms_erreur[] = array();
441
		}
435
		}
442
		
-
 
443
		$this->traiterResultatTest($info);
436
		return $noms_erreur;
444
	}
437
	}
445
	
438
	
446
	/**
439
	/**
447
	 * Test #09
440
	 * Test #09
448
	 */
441
	 */
449
	private function testerTaxSupPourTaxon() {
442
	private function testerTaxSupPourTaxon() {
450
		$info = $this->getInfosTest(9);
-
 
451
		
-
 
452
		// Réalisation du test
443
		// Réalisation du test
453
		$noms_erreur = array();
444
		$noms_erreur = array();
454
		foreach ($this->noms as &$nom) {
445
		foreach ($this->noms as &$nom) {
455
			if ($nom['num_nom_retenu'] != $nom['num_nom'] && $nom['num_tax_sup'] != '') {
446
			if ($nom['num_nom_retenu'] != $nom['num_nom'] && $nom['num_tax_sup'] != '') {
456
				$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']); 
447
				$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']); 
457
			}
448
			}
458
		}
449
		}
459
		
-
 
460
		// Analyse des résultats
-
 
461
		if (count($noms_erreur) > 0) {
450
		return $noms_erreur;
462
			$info['message']['entete'] = array('num_nom', 'num_tax_sup');
-
 
463
			$info['message']['lignes'] = $noms_erreur;
-
 
464
		} else {
-
 
465
			$info['resultat'] = true;
-
 
466
		}
-
 
467
		
-
 
468
		$this->traiterResultatTest($info);
-
 
469
	}
451
	}
470
	
452
	
471
	/**
453
	/**
472
	 * Test #10
454
	 * Test #10
473
	 */
455
	 */
474
	private function testerExitenceTaxonSuperieur() {
456
	private function testerExitenceTaxonSuperieur() {
475
		$info = $this->getInfosTest(10);
-
 
476
		
-
 
477
		// Réalisation du test
457
		// Réalisation du test
478
		$noms_erreur = array();
458
		$noms_erreur = array();
479
		foreach ($this->noms as &$nom) {
459
		foreach ($this->noms as &$nom) {
480
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
460
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
481
				if ($nom['num_tax_sup'] != 0 && !isset($this->noms[$nom['num_tax_sup']])) {
461
				if ($nom['num_tax_sup'] != 0 && !isset($this->noms[$nom['num_tax_sup']])) {
482
					$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']);
462
					$noms_erreur[] = array($nom['num_nom'], $nom['num_tax_sup']);
483
				} 
463
				} 
484
			}
464
			}
485
		}
465
		}
486
		
-
 
487
		// Analyse des résultats
-
 
488
		if (count($noms_erreur) > 0) {
466
		return $noms_erreur;
489
			$info['message']['entete'] = array('num_nom', 'num_tax_sup');
-
 
490
			$info['message']['lignes'] = $noms_erreur;
-
 
491
		} else {
-
 
492
			$info['resultat'] = true;
-
 
493
		}
-
 
494
		
-
 
495
		$this->traiterResultatTest($info);
-
 
496
	}
467
	}
497
	
468
	
498
	/**
469
	/**
499
	 * Test #11
470
	 * Test #11
500
	 */
471
	 */
501
	private function testerClassificationRang() {
472
	private function testerClassificationRang() {
502
		$info = $this->getInfosTest(11);
-
 
503
		
-
 
504
		// Réalisation du test
473
		// Réalisation du test
505
		$noms_erreur = array();
474
		$noms_erreur = array();
506
		foreach ($this->noms as &$nom) {
475
		foreach ($this->noms as &$nom) {
507
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
476
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
508
				if (isset($this->noms[$nom['num_tax_sup']])) {
477
				if (isset($this->noms[$nom['num_tax_sup']])) {
509
					$nom_sup = $this->noms[$nom['num_tax_sup']];
478
					$nom_sup = $this->noms[$nom['num_tax_sup']];
510
					if ($nom_sup['rang'] >= $nom['rang']) {
479
					if ($nom_sup['rang'] >= $nom['rang']) {
511
						// Prise en compte de l'exception des clades
480
						// Prise en compte de l'exception des clades
512
						if (! ($nom_sup['rang'] == 70 && $nom['rang'] == 70)) {
481
						if (! ($nom_sup['rang'] == 70 && $nom['rang'] == 70)) {
513
							$noms_erreur[] = array($nom['num_nom'], $nom['rang'], $nom_sup['num_nom'], $nom_sup['rang']);
482
							$noms_erreur[] = array($nom['num_nom'], $nom['rang'], $nom_sup['num_nom'], $nom_sup['rang']);
514
						}
483
						}
515
					}
484
					}
516
				}
485
				}
517
			}
486
			}
518
		}
487
		}
519
		
-
 
520
		// Analyse des résultats
-
 
521
		if (count($noms_erreur) > 0) {
488
		return $noms_erreur;
522
			$info['message']['entete'] = array('num_nom', 'rang', 'Taxon supérieur num_nom', 'Taxon supérieur rang');
-
 
523
			$info['message']['lignes'] = $noms_erreur;
-
 
524
		} else {
-
 
525
			$info['resultat'] = true;
-
 
526
		}
-
 
527
		
-
 
528
		$this->traiterResultatTest($info);
-
 
529
	}
489
	}
530
	
490
	
531
	/**
491
	/**
532
	 * Test #12
492
	 * Test #12
533
	 */
493
	 */
534
	private function testerClassification() {
494
	private function testerClassification() {
535
		$info = $this->getInfosTest(12);
-
 
536
		
-
 
537
		// Réalisation du test
495
		// Réalisation du test
538
		$noms_erreur = array();
496
		$noms_erreur = array();
539
		$this->noms_ok = array();
497
		$this->noms_ok = array();
540
		foreach ($this->noms as &$nom) {
498
		foreach ($this->noms as &$nom) {
541
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
499
			if ($nom['num_nom_retenu'] == $nom['num_nom']) {
542
				if (isset($this->noms_ok[$nom['num_tax_sup']])) {
500
				if (isset($this->noms_ok[$nom['num_tax_sup']])) {
543
					$this->noms_ok[$nom['num_nom']] = true;
501
					$this->noms_ok[$nom['num_nom']] = true;
544
				} else {
502
				} else {
545
					$this->detection_boucle_infini = array();
503
					$this->detection_boucle_infini = array();
546
					$classif_ok = $this->remonterClassif($nom);
504
					$classif_ok = $this->remonterClassif($nom);
547
					unset($this->detection_boucle_infini); 
505
					unset($this->detection_boucle_infini); 
548
					
506
					
549
					if ($classif_ok === true) {
507
					if ($classif_ok === true) {
550
						$this->noms_ok[$nom['num_nom']] = $classif_ok;
508
						$this->noms_ok[$nom['num_nom']] = $classif_ok;
551
					} else {
509
					} else {
552
						$noms_erreur[] = array($nom['num_nom'], $classif_ok);
510
						$noms_erreur[] = array($nom['num_nom'], $classif_ok);
553
					}
511
					}
554
				}
512
				}
555
			}
513
			}
556
		}
514
		}
557
		unset($this->noms_ok);
515
		unset($this->noms_ok);
558
		
-
 
559
		// Analyse des résultats
-
 
560
		if (count($noms_erreur) > 0) {
516
		return $noms_erreur;
561
			$info['message']['entete'] = array('num_nom', 'Message du problème');
-
 
562
			$info['message']['lignes'] = $noms_erreur;
-
 
563
		} else {
-
 
564
			$info['resultat'] = true;
-
 
565
		}
-
 
566
		
-
 
567
		$this->traiterResultatTest($info);
-
 
568
	}
517
	}
569
	
518
	
570
	private function remonterClassif(&$nom) {
519
	private function remonterClassif(&$nom) {
571
		$this->detection_boucle_infini[$nom['num_nom']] = true;
520
		$this->detection_boucle_infini[$nom['num_nom']] = true;
572
		if (preg_match('/^[0-9]*$/', $nom['num_tax_sup'])) {
521
		if (preg_match('/^[0-9]*$/', $nom['num_tax_sup'])) {
573
			if (isset($this->noms_ok[$nom['num_tax_sup']])) {
522
			if (isset($this->noms_ok[$nom['num_tax_sup']])) {
574
				$this->noms_ok[$nom['num_nom']] = true;
523
				$this->noms_ok[$nom['num_nom']] = true;
575
				return true;
524
				return true;
576
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] == '0') {
525
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] == '0') {
577
				$this->noms_ok[$nom['num_nom']] = true;
526
				$this->noms_ok[$nom['num_nom']] = true;
578
				return true;
527
				return true;
579
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] != '0') {
528
			} else if (!isset($this->noms[$nom['num_tax_sup']]) && $nom['num_tax_sup'] != '0') {
580
				return 'Hiérarchie avec le taxon #'.$nom['num_nom'].' ayant un taxon superieur #'.$nom['num_tax_sup'].' inexistant';
529
				return 'Hiérarchie avec le taxon #'.$nom['num_nom'].' ayant un taxon superieur #'.$nom['num_tax_sup'].' inexistant';
581
			} else if (isset($this->detection_boucle_infini[$nom['num_tax_sup']])) {
530
			} else if (isset($this->detection_boucle_infini[$nom['num_tax_sup']])) {
582
				return 'Boucle infinie pour le taxon #'.$nom['num_tax_sup'];
531
				return 'Boucle infinie pour le taxon #'.$nom['num_tax_sup'];
583
			} else {
532
			} else {
584
				$retour = $this->remonterClassif($this->noms[$nom['num_tax_sup']]);
533
				$retour = $this->remonterClassif($this->noms[$nom['num_tax_sup']]);
585
				if ($retour === true) {
534
				if ($retour === true) {
586
					$this->noms_ok[$nom['num_tax_sup']] = true;
535
					$this->noms_ok[$nom['num_tax_sup']] = true;
587
				}
536
				}
588
				return $retour;
537
				return $retour;
589
			}
538
			}
590
		} else {
539
		} else {
591
			return 'Valeur num_tax_sup incorrecte : '.$nom['num_tax_sup'];
540
			return 'Valeur num_tax_sup incorrecte : '.$nom['num_tax_sup'];
592
		}
541
		}
593
	}
542
	}
594
	
543
	
595
	/**
544
	/**
596
	 * Test #13
545
	 * Test #13
597
	 */
546
	 */
598
	private function testerRang() {
547
	private function testerRang() {
599
		$info = $this->getInfosTest(13);
-
 
600
		
-
 
601
		$rangs = array_flip(explode(',', $this->manuel['rangs']));
548
		$rangs = array_flip(explode(',', $this->manuel['rangs']));
602
		
549
		
603
		// Réalisation du test
550
		// Réalisation du test
604
		$noms_erreur = array();
551
		$noms_erreur = array();
605
		foreach ($this->noms as &$nom) {
552
		foreach ($this->noms as &$nom) {
606
			if (!isset($rangs[$nom['rang']])) {
553
			if (!isset($rangs[$nom['rang']])) {
607
				$noms_erreur[] = array($nom['num_nom'], $nom['rang']);
554
				$noms_erreur[] = array($nom['num_nom'], $nom['rang']);
608
			}
555
			}
609
		}
556
		}
610
		
-
 
611
		// Analyse des résultats
-
 
612
		if (count($noms_erreur) > 0) {
557
		return $noms_erreur;
613
			$info['message']['entete'] = array('num_nom', 'Rang');
-
 
614
			$info['message']['lignes'] = $noms_erreur;
-
 
615
		} else {
-
 
616
			$info['resultat'] = true;
-
 
617
		}
-
 
618
		
-
 
619
		$this->traiterResultatTest($info);
-
 
620
	}
558
	}
621
	
559
	
622
	/**
560
	/**
623
	 * Test #14
561
	 * Test #14
624
	 */
562
	 */
625
	private function testerNomCompletSupraGenerique() {
563
	private function testerNomCompletSupraGenerique() {
626
		$info = $this->getInfosTest(14);
-
 
627
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
-
 
628
		
-
 
629
		// Réalisation du test
564
		// Réalisation du test
630
		$noms_erreur = array();
565
		$noms_erreur = array();
631
		foreach ($this->noms as &$nom) {
566
		foreach ($this->noms as &$nom) {
632
			if ($nom['rang'] < $this->manuel['rang_genre']) {
567
			if ($nom['rang'] < $this->manuel['rang_genre']) {
633
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
568
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
634
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['nom_supra_generique']);
569
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['nom_supra_generique']);
635
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
570
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
636
				if ($nom['nom_sci'] != $nom_sci_ideal) {
571
				if ($nom['nom_sci'] != $nom_sci_ideal) {
637
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
572
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
638
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
573
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
639
				}
574
				}
640
			}
575
			}
641
		}
576
		}
642
		
-
 
643
		// Analyse des résultats
-
 
644
		if (count($noms_erreur) > 0) {
577
		return $noms_erreur;
645
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
-
 
646
			$info['message']['lignes'] = $noms_erreur;
-
 
647
		} else {
-
 
648
			$info['resultat'] = true;
-
 
649
		}
-
 
650
		
-
 
651
		$this->traiterResultatTest($info);
-
 
652
	}
578
	}
653
	
579
	
654
	/**
580
	/**
655
	 * Test #15
581
	 * Test #15
656
	 */
582
	 */
657
	private function testerNomCompletGenre() {
583
	private function testerNomCompletGenre() {
658
		$info = $this->getInfosTest(15);
-
 
659
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
-
 
660
		
-
 
661
		// Réalisation du test
584
		// Réalisation du test
662
		$noms_erreur = array();
585
		$noms_erreur = array();
663
		foreach ($this->noms as &$nom) {
586
		foreach ($this->noms as &$nom) {
664
			if ($nom['rang'] == $this->manuel['rang_genre']) {
587
			if ($nom['rang'] == $this->manuel['rang_genre']) {
665
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
588
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
666
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
589
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
667
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
590
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
668
				if ($nom['nom_sci'] != $nom_sci_ideal) {
591
				if ($nom['nom_sci'] != $nom_sci_ideal) {
669
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
592
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
670
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
593
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
671
				}
594
				}
672
			}
595
			}
673
		}
596
		}
674
		
-
 
675
		// Analyse des résultats
-
 
676
		if (count($noms_erreur) > 0) {
597
		return $noms_erreur;
677
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
-
 
678
			$info['message']['lignes'] = $noms_erreur;
-
 
679
		} else {
-
 
680
			$info['resultat'] = true;
-
 
681
		}
-
 
682
		
-
 
683
		$this->traiterResultatTest($info);
-
 
684
	}
598
	}
685
	
599
	
686
	/**
600
	/**
687
	 * Test #16
601
	 * Test #16
688
	 */
602
	 */
689
	private function testerNomCompletInfraGenre() {
603
	private function testerNomCompletInfraGenre() {
690
		$info = $this->getInfosTest(16);
-
 
691
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
-
 
692
		
-
 
693
		// Réalisation du test
604
		// Réalisation du test
694
		$noms_erreur = array();
605
		$noms_erreur = array();
695
		foreach ($this->noms as &$nom) {
606
		foreach ($this->noms as &$nom) {
696
			if ($nom['rang'] > $this->manuel['rang_genre'] && $nom['rang'] < $this->manuel['rang_sp']) {
607
			if ($nom['rang'] > $this->manuel['rang_genre'] && $nom['rang'] < $this->manuel['rang_sp']) {
697
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
608
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
698
				$nom_sci_ideal = '';
609
				$nom_sci_ideal = '';
699
				if ($nom['type_epithete'] == 'agg.') {
610
				if ($nom['type_epithete'] == 'agg.') {
700
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
611
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
701
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
612
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
702
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
613
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
703
				} else {
614
				} else {
704
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
615
					$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
705
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
616
					$nom_sci_ideal .= ' '.$nom['type_epithete'];
706
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
617
					$nom_sci_ideal .= ' '.$this->formaterStyleNomGenre($nom['epithete_infra_generique']);
707
				}
618
				}
708
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
619
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
709
				if ($nom['nom_sci'] != $nom_sci_ideal) {
620
				if ($nom['nom_sci'] != $nom_sci_ideal) {
710
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
621
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
711
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
622
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
712
				}
623
				}
713
			}
624
			}
714
		}
625
		}
715
		
-
 
716
		// Analyse des résultats
-
 
717
		if (count($noms_erreur) > 0) {
-
 
718
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
-
 
719
			$info['message']['lignes'] = $noms_erreur;
-
 
720
		} else {
-
 
721
			$info['resultat'] = true;
-
 
722
		}
-
 
723
		$noms_erreur = null;
626
		return $noms_erreur;
724
		
-
 
725
		$this->traiterResultatTest($info);
-
 
726
	}
627
	}
727
	
628
	
728
	/**
629
	/**
729
	 * Test #17
630
	 * Test #17
730
	 */
631
	 */
731
	private function testerNomCompletEspece() {
632
	private function testerNomCompletEspece() {
732
		$info = $this->getInfosTest(17);
-
 
733
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
-
 
734
		
-
 
735
		// Réalisation du test
633
		// Réalisation du test
736
		$noms_erreur = array();
634
		$noms_erreur = array();
737
		foreach ($this->noms as &$nom) {
635
		foreach ($this->noms as &$nom) {
738
			if ($nom['rang'] == $this->manuel['rang_sp']) {
636
			if ($nom['rang'] == $this->manuel['rang_sp']) {
739
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
637
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
740
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
638
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
741
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
639
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
742
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
640
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
743
				if ($nom['nom_sci'] != $nom_sci_ideal) {
641
				if ($nom['nom_sci'] != $nom_sci_ideal) {
744
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
642
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
745
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
643
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
746
				}
644
				}
747
			}
645
			}
748
		}
646
		}
749
		
-
 
750
		// Analyse des résultats
-
 
751
		if (count($noms_erreur) > 0) {
-
 
752
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
-
 
753
			$info['message']['lignes'] = $noms_erreur;
-
 
754
		} else {
-
 
755
			$info['resultat'] = true;
-
 
756
		}
-
 
757
		$noms_erreur = null;
647
		return $noms_erreur;
758
		
-
 
759
		$this->traiterResultatTest($info);
-
 
760
	}
648
	}
761
	
649
	
762
	/**
650
	/**
763
	 * Test #18
651
	 * Test #18
764
	 */
652
	 */
765
	private function testerNomCompletInfraSpecifique() {
653
	private function testerNomCompletInfraSpecifique() {
766
		$info = $this->getInfosTest(18);
-
 
767
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
-
 
768
		
-
 
769
		// Réalisation du test
654
		// Réalisation du test
770
		$noms_erreur = array();
655
		$noms_erreur = array();
771
		foreach ($this->noms as &$nom) {
656
		foreach ($this->noms as &$nom) {
772
			if ($nom['rang'] > $this->manuel['rang_sp']) {
657
			if ($nom['rang'] > $this->manuel['rang_sp']) {
773
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
658
				$suffixe_plte_cultivee = $this->construireSuffixeNomPltCultivee($nom);
774
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
659
				$nom_sci_ideal = $this->formaterStyleNomGenre($nom['genre']);
775
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
660
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_sp']);
776
				$nom_sci_ideal .= ' '.strtolower($nom['type_epithete']);
661
				$nom_sci_ideal .= ' '.strtolower($nom['type_epithete']);
777
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_infra_sp']);
662
				$nom_sci_ideal .= ' '.strtolower($nom['epithete_infra_sp']);
778
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
663
				$nom_sci_ideal .= ($suffixe_plte_cultivee != '' ? ' '.$suffixe_plte_cultivee : '');
779
				if ($nom['nom_sci'] != $nom_sci_ideal) {
664
				if ($nom['nom_sci'] != $nom_sci_ideal) {
780
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
665
					$nom_sci_traite = $this->repererEspace($nom['nom_sci']);
781
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
666
					$noms_erreur[] = array($nom['num_nom'], $nom_sci_traite, $nom_sci_ideal);
782
				}
667
				}
783
			}
668
			}
784
		}
669
		}
785
		
-
 
786
		// Analyse des résultats
-
 
787
		if (count($noms_erreur) > 0) {
-
 
788
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'nom_sci corrigé');
-
 
789
			$info['message']['lignes'] = $noms_erreur;
-
 
790
		} else {
-
 
791
			$info['resultat'] = true;
-
 
792
		}
-
 
793
		$noms_erreur = null;
670
		return $noms_erreur;
794
		
-
 
795
		$this->traiterResultatTest($info);
-
 
796
	}
671
	}
797
	
672
	
798
	/**
673
	/**
799
	 * Test #19
674
	 * Test #19
800
	 */
675
	 */
801
	private function testerNomSupraGeneriqueEspaces() {
676
	private function testerNomSupraGeneriqueEspaces() {
802
		$info = $this->getInfosTest(19);
-
 
803
		
-
 
804
		// Réalisation du test
677
		// Réalisation du test
805
		$noms_erreur = array();
678
		$noms_erreur = array();
806
		foreach ($this->noms as &$nom) {
679
		foreach ($this->noms as &$nom) {
807
			if ($nom['nom_supra_generique'] != '') {
680
			if ($nom['nom_supra_generique'] != '') {
808
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s+$)/', $nom['nom_supra_generique'])) {
681
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s+$)/', $nom['nom_supra_generique'])) {
809
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
682
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
810
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
683
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
811
				}
684
				}
812
			}
685
			}
813
		}
686
		}
814
		
-
 
815
		// Analyse des résultats
-
 
816
		if (count($noms_erreur) > 0) {
-
 
817
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
-
 
818
			$info['message']['lignes'] = $noms_erreur;
-
 
819
		} else {
-
 
820
			$info['resultat'] = true;
-
 
821
		}
-
 
822
		$noms_erreur = null;
687
		return $noms_erreur;
823
		
-
 
824
		$this->traiterResultatTest($info);
-
 
825
	}
688
	}
826
	
689
	
827
	/**
690
	/**
828
	 * Test #20
691
	 * Test #20
829
	 */
692
	 */
830
	private function testerNomSupraGeneriqueSyntaxe() {
693
	private function testerNomSupraGeneriqueSyntaxe() {
831
		$info = $this->getInfosTest(20);
694
		$info = $this->getInfosTest(20);
832
		
695
		
833
		// Réalisation du test
696
		// Réalisation du test
834
		$noms_erreur = array();
697
		$noms_erreur = array();
835
		foreach ($this->noms as &$nom) {
698
		foreach ($this->noms as &$nom) {
836
			if ($nom['nom_supra_generique'] != '') {
699
			if ($nom['nom_supra_generique'] != '') {
837
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+$/', $nom['nom_supra_generique'])) {
700
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+$/', $nom['nom_supra_generique'])) {
838
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
701
					$nom_supra_generique_traite = $this->repererEspace($nom['nom_supra_generique']);
839
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
702
					$noms_erreur[] = array($nom['num_nom'], $nom_supra_generique_traite);
840
				}
703
				}
841
			}
704
			}
842
		}
705
		}
843
		
706
		
844
		// Analyse des résultats
707
		// Analyse des résultats
845
		if (count($noms_erreur) > 0) {
708
		if (count($noms_erreur) > 0) {
846
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
709
			$info['message']['entete'] = array('num_nom', 'nom_supra_generique erroné');
847
			$info['message']['lignes'] = $noms_erreur;
710
			$info['message']['lignes'] = $noms_erreur;
848
		} else {
711
		} else {
849
			$info['resultat'] = true;
712
			$info['resultat'] = true;
850
		}
713
		}
851
		$noms_erreur = null;
714
		$noms_erreur = null;
852
		
715
		
853
		$this->traiterResultatTest($info);
716
		$this->traiterResultatTest($info);
854
	}
717
	}
855
	
718
	
856
	/**
719
	/**
857
	 * Test #21
720
	 * Test #21
858
	 */
721
	 */
859
	private function testerNomSupraGeneriqueRang() {
722
	private function testerNomSupraGeneriqueRang() {
860
		$info = $this->getInfosTest(21);
723
		$info = $this->getInfosTest(21);
861
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
724
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
862
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
725
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
863
		
726
		
864
		// Réalisation du test
727
		// Réalisation du test
865
		$noms_erreur = array();
728
		$noms_erreur = array();
866
		foreach ($this->noms as &$nom) {
729
		foreach ($this->noms as &$nom) {
867
			if ($nom['nom_supra_generique'] != '') {
730
			if ($nom['nom_supra_generique'] != '') {
868
				if ($nom['rang'] >= $this->manuel['rang_genre']) {
731
				if ($nom['rang'] >= $this->manuel['rang_genre']) {
869
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
732
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
870
				}
733
				}
871
			}
734
			}
872
		}
735
		}
873
		
736
		
874
		// Analyse des résultats
737
		// Analyse des résultats
875
		if (count($noms_erreur) > 0) {
738
		if (count($noms_erreur) > 0) {
876
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
739
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
877
			$info['message']['lignes'] = $noms_erreur;
740
			$info['message']['lignes'] = $noms_erreur;
878
		} else {
741
		} else {
879
			$info['resultat'] = true;
742
			$info['resultat'] = true;
880
		}
743
		}
881
		$noms_erreur = null;
744
		$noms_erreur = null;
882
		
745
		
883
		$this->traiterResultatTest($info);
746
		$this->traiterResultatTest($info);
884
	}
747
	}
885
	
748
	
886
	/**
749
	/**
887
	 * Test #22
750
	 * Test #22
888
	 */
751
	 */
889
	private function testerGenreEspaces() {
752
	private function testerGenreEspaces() {
890
		$info = $this->getInfosTest(22);
753
		$info = $this->getInfosTest(22);
891
		
754
		
892
		// Réalisation du test
755
		// Réalisation du test
893
		$noms_erreur = array();
756
		$noms_erreur = array();
894
		foreach ($this->noms as &$nom) {
757
		foreach ($this->noms as &$nom) {
895
			if ($nom['genre'] != '') {
758
			if ($nom['genre'] != '') {
896
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['genre'])) {
759
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['genre'])) {
897
					$nom_traite = $this->repererEspace($nom['genre']);
760
					$nom_traite = $this->repererEspace($nom['genre']);
898
					$noms_erreur[] = array($nom['num_nom'], $nom_traite);
761
					$noms_erreur[] = array($nom['num_nom'], $nom_traite);
899
				}
762
				}
900
			}
763
			}
901
		}
764
		}
902
		
765
		
903
		// Analyse des résultats
766
		// Analyse des résultats
904
		if (count($noms_erreur) > 0) {
767
		if (count($noms_erreur) > 0) {
905
			$info['message']['entete'] = array('num_nom', 'genre erroné');
768
			$info['message']['entete'] = array('num_nom', 'genre erroné');
906
			$info['message']['lignes'] = $noms_erreur;
769
			$info['message']['lignes'] = $noms_erreur;
907
		} else {
770
		} else {
908
			$info['resultat'] = true;
771
			$info['resultat'] = true;
909
		}
772
		}
910
		$noms_erreur = null;
773
		$noms_erreur = null;
911
		
774
		
912
		$this->traiterResultatTest($info);
775
		$this->traiterResultatTest($info);
913
	}
776
	}
914
	
777
	
915
	/**
778
	/**
916
	 * Test #23
779
	 * Test #23
917
	 */
780
	 */
918
	private function testerGenreSyntaxe() {
781
	private function testerGenreSyntaxe() {
919
		$info = $this->getInfosTest(23);
782
		$info = $this->getInfosTest(23);
920
		
783
		
921
		// Réalisation du test
784
		// Réalisation du test
922
		$noms_erreur = array();
785
		$noms_erreur = array();
923
		foreach ($this->noms as &$nom) {
786
		foreach ($this->noms as &$nom) {
924
			if ($nom['genre'] != '') {
787
			if ($nom['genre'] != '') {
925
				$mots = explode(' ', $nom['genre']);
788
				$mots = explode(' ', $nom['genre']);
926
				foreach ($mots as $mot) {
789
				foreach ($mots as $mot) {
927
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteGenre($mot))) {
790
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteGenre($mot))) {
928
						$nom_traite = $this->repererEspace($nom['genre']);
791
						$nom_traite = $this->repererEspace($nom['genre']);
929
						$noms_erreur[] = array($nom['num_nom'], $nom_traite);
792
						$noms_erreur[] = array($nom['num_nom'], $nom_traite);
930
					}
793
					}
931
				}
794
				}
932
			}
795
			}
933
		}
796
		}
934
		
797
		
935
		// Analyse des résultats
798
		// Analyse des résultats
936
		if (count($noms_erreur) > 0) {
799
		if (count($noms_erreur) > 0) {
937
			$info['message']['entete'] = array('num_nom', 'genre erroné');
800
			$info['message']['entete'] = array('num_nom', 'genre erroné');
938
			$info['message']['lignes'] = $noms_erreur;
801
			$info['message']['lignes'] = $noms_erreur;
939
		} else {
802
		} else {
940
			$info['resultat'] = true;
803
			$info['resultat'] = true;
941
		}
804
		}
942
		$noms_erreur = null;
805
		$noms_erreur = null;
943
		
806
		
944
		$this->traiterResultatTest($info);
807
		$this->traiterResultatTest($info);
945
	}
808
	}
946
	
809
	
947
	/**
810
	/**
948
	 * Test #24
811
	 * Test #24
949
	 */
812
	 */
950
	private function testerGenreRang() {
813
	private function testerGenreRang() {
951
		$info = $this->getInfosTest(24);
814
		$info = $this->getInfosTest(24);
952
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
815
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
953
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
816
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
954
		
817
		
955
		// Réalisation du test
818
		// Réalisation du test
956
		$noms_erreur = array();
819
		$noms_erreur = array();
957
		foreach ($this->noms as &$nom) {
820
		foreach ($this->noms as &$nom) {
958
			if ($nom['genre'] != '') {
821
			if ($nom['genre'] != '') {
959
				if ($nom['rang'] < $this->manuel['rang_genre']) {
822
				if ($nom['rang'] < $this->manuel['rang_genre']) {
960
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
823
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
961
				}
824
				}
962
			}
825
			}
963
		}
826
		}
964
		
827
		
965
		// Analyse des résultats
828
		// Analyse des résultats
966
		if (count($noms_erreur) > 0) {
829
		if (count($noms_erreur) > 0) {
967
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
830
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
968
			$info['message']['lignes'] = $noms_erreur;
831
			$info['message']['lignes'] = $noms_erreur;
969
		} else {
832
		} else {
970
			$info['resultat'] = true;
833
			$info['resultat'] = true;
971
		}
834
		}
972
		$noms_erreur = null;
835
		$noms_erreur = null;
973
		
836
		
974
		$this->traiterResultatTest($info);
837
		$this->traiterResultatTest($info);
975
	}
838
	}
976
		
839
		
977
	/**
840
	/**
978
	 * Test #25
841
	 * Test #25
979
	 */
842
	 */
980
	private function testerEpitheteInfraGeneriqueSyntaxe() {
843
	private function testerEpitheteInfraGeneriqueSyntaxe() {
981
		$info = $this->getInfosTest(25);
844
		$info = $this->getInfosTest(25);
982
		
845
		
983
		// Réalisation du test
846
		// Réalisation du test
984
		$noms_erreur = array();
847
		$noms_erreur = array();
985
		foreach ($this->noms as &$nom) {
848
		foreach ($this->noms as &$nom) {
986
			if ($nom['epithete_infra_generique'] != '') {
849
			if ($nom['epithete_infra_generique'] != '') {
987
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+/', $nom['epithete_infra_generique'])) {
850
				if (!preg_match('/^[A-ZÄËḦÏÖÜẄẌŸ][-a-zäëḧïöẗüẅẍÿ]+/', $nom['epithete_infra_generique'])) {
988
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
851
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
989
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
852
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
990
				}
853
				}
991
			}
854
			}
992
		}
855
		}
993
		
856
		
994
		// Analyse des résultats
857
		// Analyse des résultats
995
		if (count($noms_erreur) > 0) {
858
		if (count($noms_erreur) > 0) {
996
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
859
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
997
			$info['message']['lignes'] = $noms_erreur;
860
			$info['message']['lignes'] = $noms_erreur;
998
		} else {
861
		} else {
999
			$info['resultat'] = true;
862
			$info['resultat'] = true;
1000
		}
863
		}
1001
		$noms_erreur = null;
864
		$noms_erreur = null;
1002
		
865
		
1003
		$this->traiterResultatTest($info);
866
		$this->traiterResultatTest($info);
1004
	}
867
	}
1005
	
868
	
1006
	/**
869
	/**
1007
	 * Test #26
870
	 * Test #26
1008
	 */
871
	 */
1009
	private function testerEpitheteInfraGeneriqueRang() {
872
	private function testerEpitheteInfraGeneriqueRang() {
1010
		$info = $this->getInfosTest(26);
873
		$info = $this->getInfosTest(26);
1011
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
874
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
1012
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
875
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre'], $this->manuel['rang_sp']);
1013
		
876
		
1014
		// Réalisation du test
877
		// Réalisation du test
1015
		$noms_erreur = array();
878
		$noms_erreur = array();
1016
		foreach ($this->noms as &$nom) {
879
		foreach ($this->noms as &$nom) {
1017
			if ($nom['epithete_infra_generique'] != '') {
880
			if ($nom['epithete_infra_generique'] != '') {
1018
				if ($nom['rang'] <= $this->manuel['rang_genre'] || $nom['rang'] >= $this->manuel['rang_sp']) {
881
				if ($nom['rang'] <= $this->manuel['rang_genre'] || $nom['rang'] >= $this->manuel['rang_sp']) {
1019
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
882
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1020
				}
883
				}
1021
			}
884
			}
1022
		}
885
		}
1023
		
886
		
1024
		// Analyse des résultats
887
		// Analyse des résultats
1025
		if (count($noms_erreur) > 0) {
888
		if (count($noms_erreur) > 0) {
1026
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
889
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1027
			$info['message']['lignes'] = $noms_erreur;
890
			$info['message']['lignes'] = $noms_erreur;
1028
		} else {
891
		} else {
1029
			$info['resultat'] = true;
892
			$info['resultat'] = true;
1030
		}
893
		}
1031
		$noms_erreur = null;
894
		$noms_erreur = null;
1032
		
895
		
1033
		$this->traiterResultatTest($info);
896
		$this->traiterResultatTest($info);
1034
	}
897
	}
1035
	
898
	
1036
	/**
899
	/**
1037
	 * Test #27
900
	 * Test #27
1038
	 */
901
	 */
1039
	private function testerEpitheteInfraGeneriqueEspaces() {
902
	private function testerEpitheteInfraGeneriqueEspaces() {
1040
		$info = $this->getInfosTest(27);
903
		$info = $this->getInfosTest(27);
1041
		
904
		
1042
		// Réalisation du test
905
		// Réalisation du test
1043
		$noms_erreur = array();
906
		$noms_erreur = array();
1044
		foreach ($this->noms as &$nom) {
907
		foreach ($this->noms as &$nom) {
1045
			if ($nom['epithete_infra_generique'] != '') {
908
			if ($nom['epithete_infra_generique'] != '') {
1046
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_generique'])) {
909
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_generique'])) {
1047
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
910
					$epithete_traite = $this->repererEspace($nom['epithete_infra_generique']);
1048
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
911
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1049
				}
912
				}
1050
			}
913
			}
1051
		}
914
		}
1052
		
915
		
1053
		// Analyse des résultats
916
		// Analyse des résultats
1054
		if (count($noms_erreur) > 0) {
917
		if (count($noms_erreur) > 0) {
1055
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
918
			$info['message']['entete'] = array('num_nom', 'epithete_infra_generique erroné');
1056
			$info['message']['lignes'] = $noms_erreur;
919
			$info['message']['lignes'] = $noms_erreur;
1057
		} else {
920
		} else {
1058
			$info['resultat'] = true;
921
			$info['resultat'] = true;
1059
		}
922
		}
1060
		$noms_erreur = null;
923
		$noms_erreur = null;
1061
		
924
		
1062
		$this->traiterResultatTest($info);
925
		$this->traiterResultatTest($info);
1063
	}
926
	}
1064
	
927
	
1065
	/**
928
	/**
1066
	 * Test #28
929
	 * Test #28
1067
	 */
930
	 */
1068
	private function testerEpitheteSpEspaces() {
931
	private function testerEpitheteSpEspaces() {
1069
		$info = $this->getInfosTest(28);
932
		$info = $this->getInfosTest(28);
1070
		
933
		
1071
		// Réalisation du test
934
		// Réalisation du test
1072
		$noms_erreur = array();
935
		$noms_erreur = array();
1073
		foreach ($this->noms as &$nom) {
936
		foreach ($this->noms as &$nom) {
1074
			if ($nom['epithete_sp'] != '') {
937
			if ($nom['epithete_sp'] != '') {
1075
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_sp'])) {
938
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_sp'])) {
1076
					$epithete_traite = $this->repererEspace($nom['epithete_sp']);
939
					$epithete_traite = $this->repererEspace($nom['epithete_sp']);
1077
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
940
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1078
				}
941
				}
1079
			}
942
			}
1080
		}
943
		}
1081
		
944
		
1082
		// Analyse des résultats
945
		// Analyse des résultats
1083
		if (count($noms_erreur) > 0) {
946
		if (count($noms_erreur) > 0) {
1084
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
947
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1085
			$info['message']['lignes'] = $noms_erreur;
948
			$info['message']['lignes'] = $noms_erreur;
1086
		} else {
949
		} else {
1087
			$info['resultat'] = true;
950
			$info['resultat'] = true;
1088
		}
951
		}
1089
		$noms_erreur = null;
952
		$noms_erreur = null;
1090
		
953
		
1091
		$this->traiterResultatTest($info);
954
		$this->traiterResultatTest($info);
1092
	}
955
	}
1093
	
956
	
1094
	/**
957
	/**
1095
	 * Test #29
958
	 * Test #29
1096
	 */
959
	 */
1097
	private function testerEpitheteSpSyntaxe() {
960
	private function testerEpitheteSpSyntaxe() {
1098
		$info = $this->getInfosTest(29);
961
		$info = $this->getInfosTest(29);
1099
		
962
		
1100
		// Réalisation du test
963
		// Réalisation du test
1101
		$noms_erreur = array();
964
		$noms_erreur = array();
1102
		foreach ($this->noms as &$nom) {
965
		foreach ($this->noms as &$nom) {
1103
			if ($nom['epithete_sp'] != '') {
966
			if ($nom['epithete_sp'] != '') {
1104
				$mots = explode(' ', $nom['epithete_sp']);
967
				$mots = explode(' ', $nom['epithete_sp']);
1105
				foreach ($mots as $mot) {
968
				foreach ($mots as $mot) {
1106
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteSp($mot))) {
969
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierEpitheteSp($mot))) {
1107
						$epithete_traite = $this->repererEspace($nom['epithete_sp']);
970
						$epithete_traite = $this->repererEspace($nom['epithete_sp']);
1108
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
971
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1109
					}
972
					}
1110
				}
973
				}
1111
			}
974
			}
1112
		}
975
		}
1113
		
976
		
1114
		// Analyse des résultats
977
		// Analyse des résultats
1115
		if (count($noms_erreur) > 0) {
978
		if (count($noms_erreur) > 0) {
1116
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
979
			$info['message']['entete'] = array('num_nom', 'epithete_sp erroné');
1117
			$info['message']['lignes'] = $noms_erreur;
980
			$info['message']['lignes'] = $noms_erreur;
1118
		} else {
981
		} else {
1119
			$info['resultat'] = true;
982
			$info['resultat'] = true;
1120
		}
983
		}
1121
		$noms_erreur = null;
984
		$noms_erreur = null;
1122
		
985
		
1123
		$this->traiterResultatTest($info);
986
		$this->traiterResultatTest($info);
1124
	}
987
	}
1125
	
988
	
1126
	/**
989
	/**
1127
	 * Test #30
990
	 * Test #30
1128
	 */
991
	 */
1129
	private function testerEpitheteSpRang() {
992
	private function testerEpitheteSpRang() {
1130
		$info = $this->getInfosTest(30);
993
		$info = $this->getInfosTest(30);
1131
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
994
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
1132
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
995
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
1133
		
996
		
1134
		// Réalisation du test
997
		// Réalisation du test
1135
		$noms_erreur = array();
998
		$noms_erreur = array();
1136
		foreach ($this->noms as &$nom) {
999
		foreach ($this->noms as &$nom) {
1137
			if ($nom['epithete_sp'] != '') {
1000
			if ($nom['epithete_sp'] != '') {
1138
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1001
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1139
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1002
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1140
				}
1003
				}
1141
			}
1004
			}
1142
		}
1005
		}
1143
		
1006
		
1144
		// Analyse des résultats
1007
		// Analyse des résultats
1145
		if (count($noms_erreur) > 0) {
1008
		if (count($noms_erreur) > 0) {
1146
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1009
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1147
			$info['message']['lignes'] = $noms_erreur;
1010
			$info['message']['lignes'] = $noms_erreur;
1148
		} else {
1011
		} else {
1149
			$info['resultat'] = true;
1012
			$info['resultat'] = true;
1150
		}
1013
		}
1151
		$noms_erreur = null;
1014
		$noms_erreur = null;
1152
		
1015
		
1153
		$this->traiterResultatTest($info);
1016
		$this->traiterResultatTest($info);
1154
	}
1017
	}
1155
	
1018
	
1156
	/**
1019
	/**
1157
	 * Test #31
1020
	 * Test #31
1158
	 */
1021
	 */
1159
	private function testerTypeEpitheteEspaces() {
1022
	private function testerTypeEpitheteEspaces() {
1160
		$info = $this->getInfosTest(31);
1023
		$info = $this->getInfosTest(31);
1161
		
1024
		
1162
		// Réalisation du test
1025
		// Réalisation du test
1163
		$noms_erreur = array();
1026
		$noms_erreur = array();
1164
		foreach ($this->noms as &$nom) {
1027
		foreach ($this->noms as &$nom) {
1165
			if ($nom['type_epithete'] != '') {
1028
			if ($nom['type_epithete'] != '') {
1166
				if (preg_match('/\s+/', $nom['type_epithete'])) {
1029
				if (preg_match('/\s+/', $nom['type_epithete'])) {
1167
					$valeur_traitee = $this->repererEspace($nom['epithete_sp']);
1030
					$valeur_traitee = $this->repererEspace($nom['epithete_sp']);
1168
					$noms_erreur[] = array($nom['num_nom'], $valeur_traitee);
1031
					$noms_erreur[] = array($nom['num_nom'], $valeur_traitee);
1169
				}
1032
				}
1170
			}
1033
			}
1171
		}
1034
		}
1172
		
1035
		
1173
		// Analyse des résultats
1036
		// Analyse des résultats
1174
		if (count($noms_erreur) > 0) {
1037
		if (count($noms_erreur) > 0) {
1175
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1038
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1176
			$info['message']['lignes'] = $noms_erreur;
1039
			$info['message']['lignes'] = $noms_erreur;
1177
		} else {
1040
		} else {
1178
			$info['resultat'] = true;
1041
			$info['resultat'] = true;
1179
		}
1042
		}
1180
		
1043
		
1181
		$this->traiterResultatTest($info);
1044
		$this->traiterResultatTest($info);
1182
	}
1045
	}
1183
	
1046
	
1184
	/**
1047
	/**
1185
	 * Test #32
1048
	 * Test #32
1186
	 */
1049
	 */
1187
	private function testerTypeEpitheteSyntaxe() {
1050
	private function testerTypeEpitheteSyntaxe() {
1188
		$info = $this->getInfosTest(32);
1051
		$info = $this->getInfosTest(32);
1189
		
1052
		
1190
		// Réalisation du test
1053
		// Réalisation du test
1191
		$noms_erreur = array();
1054
		$noms_erreur = array();
1192
		foreach ($this->noms as &$nom) {
1055
		foreach ($this->noms as &$nom) {
1193
			if ($nom['type_epithete'] != '') {
1056
			if ($nom['type_epithete'] != '') {
1194
				if (!$this->verifierTypeEpithete($nom['type_epithete'])) {
1057
				if (!$this->verifierTypeEpithete($nom['type_epithete'])) {
1195
					$noms_erreur[] = array($nom['num_nom'],  $nom['type_epithete']);
1058
					$noms_erreur[] = array($nom['num_nom'],  $nom['type_epithete']);
1196
				}
1059
				}
1197
			}
1060
			}
1198
		}
1061
		}
1199
		
1062
		
1200
		// Analyse des résultats
1063
		// Analyse des résultats
1201
		if (count($noms_erreur) > 0) {
1064
		if (count($noms_erreur) > 0) {
1202
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1065
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1203
			$info['message']['lignes'] = $noms_erreur;
1066
			$info['message']['lignes'] = $noms_erreur;
1204
		} else {
1067
		} else {
1205
			$info['resultat'] = true;
1068
			$info['resultat'] = true;
1206
		}
1069
		}
1207
		
1070
		
1208
		$this->traiterResultatTest($info);
1071
		$this->traiterResultatTest($info);
1209
	}
1072
	}
1210
	
1073
	
1211
	/**
1074
	/**
1212
	 * Test #33
1075
	 * Test #33
1213
	 */
1076
	 */
1214
	private function testerTypeEpitheteHybridite() {
1077
	private function testerTypeEpitheteHybridite() {
1215
		$info = $this->getInfosTest(33);
1078
		$info = $this->getInfosTest(33);
1216
		
1079
		
1217
		// Réalisation du test
1080
		// Réalisation du test
1218
		$noms_erreur = array();
1081
		$noms_erreur = array();
1219
		foreach ($this->noms as &$nom) {
1082
		foreach ($this->noms as &$nom) {
1220
			if ($nom['type_epithete'] != '') {
1083
			if ($nom['type_epithete'] != '') {
1221
				if (preg_match('/^(?:n-|notho-)/', $nom['type_epithete'])) {
1084
				if (preg_match('/^(?:n-|notho-)/', $nom['type_epithete'])) {
1222
					$noms_erreur[] = array($nom['num_nom'], $nom['type_epithete']);
1085
					$noms_erreur[] = array($nom['num_nom'], $nom['type_epithete']);
1223
				}
1086
				}
1224
			}
1087
			}
1225
		}
1088
		}
1226
		
1089
		
1227
		// Analyse des résultats
1090
		// Analyse des résultats
1228
		if (count($noms_erreur) > 0) {
1091
		if (count($noms_erreur) > 0) {
1229
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1092
			$info['message']['entete'] = array('num_nom', 'type_epithete erroné');
1230
			$info['message']['lignes'] = $noms_erreur;
1093
			$info['message']['lignes'] = $noms_erreur;
1231
		} else {
1094
		} else {
1232
			$info['resultat'] = true;
1095
			$info['resultat'] = true;
1233
		}
1096
		}
1234
		
1097
		
1235
		$this->traiterResultatTest($info);
1098
		$this->traiterResultatTest($info);
1236
	}
1099
	}
1237
	
1100
	
1238
	/**
1101
	/**
1239
	 * Test #34
1102
	 * Test #34
1240
	 */
1103
	 */
1241
	private function testerEpitheteInfraSpEspaces() {
1104
	private function testerEpitheteInfraSpEspaces() {
1242
		$info = $this->getInfosTest(34);
1105
		$info = $this->getInfosTest(34);
1243
		
1106
		
1244
		// Réalisation du test
1107
		// Réalisation du test
1245
		$noms_erreur = array();
1108
		$noms_erreur = array();
1246
		foreach ($this->noms as &$nom) {
1109
		foreach ($this->noms as &$nom) {
1247
			if ($nom['epithete_infra_sp'] != '') {
1110
			if ($nom['epithete_infra_sp'] != '') {
1248
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_sp'])) {
1111
				if (preg_match('/(?:^\s+(?!:\s+)|(?!:\s+)\s{2,}(?!:\s+)|(?!:\s+)\s+$)/', $nom['epithete_infra_sp'])) {
1249
					$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1112
					$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1250
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1113
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1251
				}
1114
				}
1252
			}
1115
			}
1253
		}
1116
		}
1254
		
1117
		
1255
		// Analyse des résultats
1118
		// Analyse des résultats
1256
		if (count($noms_erreur) > 0) {
1119
		if (count($noms_erreur) > 0) {
1257
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1120
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1258
			$info['message']['lignes'] = $noms_erreur;
1121
			$info['message']['lignes'] = $noms_erreur;
1259
		} else {
1122
		} else {
1260
			$info['resultat'] = true;
1123
			$info['resultat'] = true;
1261
		}
1124
		}
1262
		$noms_erreur = null;
1125
		$noms_erreur = null;
1263
		
1126
		
1264
		$this->traiterResultatTest($info);
1127
		$this->traiterResultatTest($info);
1265
	}
1128
	}
1266
	
1129
	
1267
	/**
1130
	/**
1268
	 * Test #35
1131
	 * Test #35
1269
	 */
1132
	 */
1270
	private function testerEpitheteInfraSpSyntaxe() {
1133
	private function testerEpitheteInfraSpSyntaxe() {
1271
		$info = $this->getInfosTest(35);
1134
		$info = $this->getInfosTest(35);
1272
		
1135
		
1273
		// Réalisation du test
1136
		// Réalisation du test
1274
		$noms_erreur = array();
1137
		$noms_erreur = array();
1275
		foreach ($this->noms as &$nom) {
1138
		foreach ($this->noms as &$nom) {
1276
			if ($nom['epithete_infra_sp'] != '') {
1139
			if ($nom['epithete_infra_sp'] != '') {
1277
				$mots = explode(' ', $nom['epithete_infra_sp']);
1140
				$mots = explode(' ', $nom['epithete_infra_sp']);
1278
				foreach ($mots as $mot) {
1141
				foreach ($mots as $mot) {
1279
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierTypeEpithete($mot)|| $this->verifierEpitheteSp($mot))) {
1142
					if (!(preg_match('/^[+x]$/', $mot) || $this->verifierTypeEpithete($mot)|| $this->verifierEpitheteSp($mot))) {
1280
						$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1143
						$epithete_traite = $this->repererEspace($nom['epithete_infra_sp']);
1281
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1144
						$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1282
					}
1145
					}
1283
				}
1146
				}
1284
			}
1147
			}
1285
		}
1148
		}
1286
		
1149
		
1287
		// Analyse des résultats
1150
		// Analyse des résultats
1288
		if (count($noms_erreur) > 0) {
1151
		if (count($noms_erreur) > 0) {
1289
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1152
			$info['message']['entete'] = array('num_nom', 'epithete_infra_sp erroné');
1290
			$info['message']['lignes'] = $noms_erreur;
1153
			$info['message']['lignes'] = $noms_erreur;
1291
		} else {
1154
		} else {
1292
			$info['resultat'] = true;
1155
			$info['resultat'] = true;
1293
		}
1156
		}
1294
		$noms_erreur = null;
1157
		$noms_erreur = null;
1295
		
1158
		
1296
		$this->traiterResultatTest($info);
1159
		$this->traiterResultatTest($info);
1297
	}
1160
	}
1298
	
1161
	
1299
	/**
1162
	/**
1300
	 * Test #36
1163
	 * Test #36
1301
	 */
1164
	 */
1302
	private function testerEpitheteInfraSpRang() {
1165
	private function testerEpitheteInfraSpRang() {
1303
		$info = $this->getInfosTest(36);
1166
		$info = $this->getInfosTest(36);
1304
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
1167
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_sp']);
1305
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
1168
		$info['description'] = sprintf($info['description'], $this->manuel['rang_sp']);
1306
		
1169
		
1307
		// Réalisation du test
1170
		// Réalisation du test
1308
		$noms_erreur = array();
1171
		$noms_erreur = array();
1309
		foreach ($this->noms as &$nom) {
1172
		foreach ($this->noms as &$nom) {
1310
			if ($nom['epithete_infra_sp'] != '') {
1173
			if ($nom['epithete_infra_sp'] != '') {
1311
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1174
				if ($nom['rang'] < $this->manuel['rang_sp']) {
1312
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1175
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1313
				}
1176
				}
1314
			}
1177
			}
1315
		}
1178
		}
1316
		
1179
		
1317
		// Analyse des résultats
1180
		// Analyse des résultats
1318
		if (count($noms_erreur) > 0) {
1181
		if (count($noms_erreur) > 0) {
1319
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1182
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1320
			$info['message']['lignes'] = $noms_erreur;
1183
			$info['message']['lignes'] = $noms_erreur;
1321
		} else {
1184
		} else {
1322
			$info['resultat'] = true;
1185
			$info['resultat'] = true;
1323
		}
1186
		}
1324
		$noms_erreur = null;
1187
		$noms_erreur = null;
1325
		
1188
		
1326
		$this->traiterResultatTest($info);
1189
		$this->traiterResultatTest($info);
1327
	}
1190
	}
1328
	
1191
	
1329
	/**
1192
	/**
1330
	 * Test #37
1193
	 * Test #37
1331
	 */
1194
	 */
1332
	private function testerGroupeCultivarSyntaxe() {
1195
	private function testerGroupeCultivarSyntaxe() {
1333
		$info = $this->getInfosTest(37);
1196
		$info = $this->getInfosTest(37);
1334
		
1197
		
1335
		// Réalisation du test
1198
		// Réalisation du test
1336
		$noms_erreur = array();
1199
		$noms_erreur = array();
1337
		foreach ($this->noms as &$nom) {
1200
		foreach ($this->noms as &$nom) {
1338
			if ($nom['cultivar_groupe'] != '') {
1201
			if ($nom['cultivar_groupe'] != '') {
1339
				if (!$this->verifierEpitheteGroupeCultivar($nom['cultivar_groupe'])) {
1202
				if (!$this->verifierEpitheteGroupeCultivar($nom['cultivar_groupe'])) {
1340
					$epithete_traite = $this->repererEspace($nom['cultivar_groupe']);
1203
					$epithete_traite = $this->repererEspace($nom['cultivar_groupe']);
1341
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1204
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1342
				}
1205
				}
1343
			}
1206
			}
1344
		}
1207
		}
1345
		
1208
		
1346
		// Analyse des résultats
1209
		// Analyse des résultats
1347
		if (count($noms_erreur) > 0) {
1210
		if (count($noms_erreur) > 0) {
1348
			$info['message']['entete'] = array('num_nom', 'cultivar_groupe erroné');
1211
			$info['message']['entete'] = array('num_nom', 'cultivar_groupe erroné');
1349
			$info['message']['lignes'] = $noms_erreur;
1212
			$info['message']['lignes'] = $noms_erreur;
1350
		} else {
1213
		} else {
1351
			$info['resultat'] = true;
1214
			$info['resultat'] = true;
1352
		}
1215
		}
1353
		$noms_erreur = null;
1216
		$noms_erreur = null;
1354
		
1217
		
1355
		$this->traiterResultatTest($info);
1218
		$this->traiterResultatTest($info);
1356
	}
1219
	}
1357
	
1220
	
1358
	/**
1221
	/**
1359
	 * Test #38
1222
	 * Test #38
1360
	 */
1223
	 */
1361
	private function testerGroupeCultivarRang() {
1224
	private function testerGroupeCultivarRang() {
1362
		$info = $this->getInfosTest(38);
1225
		$info = $this->getInfosTest(38);
1363
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1226
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1364
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1227
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1365
		
1228
		
1366
		// Réalisation du test
1229
		// Réalisation du test
1367
		$noms_erreur = array();
1230
		$noms_erreur = array();
1368
		foreach ($this->noms as &$nom) {
1231
		foreach ($this->noms as &$nom) {
1369
			if ($nom['cultivar_groupe'] != '') {
1232
			if ($nom['cultivar_groupe'] != '') {
1370
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1233
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1371
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1234
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1372
				}
1235
				}
1373
			}
1236
			}
1374
		}
1237
		}
1375
		
1238
		
1376
		// Analyse des résultats
1239
		// Analyse des résultats
1377
		if (count($noms_erreur) > 0) {
1240
		if (count($noms_erreur) > 0) {
1378
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1241
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1379
			$info['message']['lignes'] = $noms_erreur;
1242
			$info['message']['lignes'] = $noms_erreur;
1380
		} else {
1243
		} else {
1381
			$info['resultat'] = true;
1244
			$info['resultat'] = true;
1382
		}
1245
		}
1383
		$noms_erreur = null;
1246
		$noms_erreur = null;
1384
		
1247
		
1385
		$this->traiterResultatTest($info);
1248
		$this->traiterResultatTest($info);
1386
	}
1249
	}
1387
	
1250
	
1388
	/**
1251
	/**
1389
	 * Test #39
1252
	 * Test #39
1390
	 */
1253
	 */
1391
	private function testerCultivarSyntaxe() {
1254
	private function testerCultivarSyntaxe() {
1392
		$info = $this->getInfosTest(39);
1255
		$info = $this->getInfosTest(39);
1393
 
1256
 
1394
		// Réalisation du test
1257
		// Réalisation du test
1395
		$noms_erreur = array();
1258
		$noms_erreur = array();
1396
		foreach ($this->noms as &$nom) {
1259
		foreach ($this->noms as &$nom) {
1397
			if ($nom['cultivar'] != '') {
1260
			if ($nom['cultivar'] != '') {
1398
				if (!$this->verifierEpitheteCultivar($nom['cultivar'])) {
1261
				if (!$this->verifierEpitheteCultivar($nom['cultivar'])) {
1399
					$epithete_traite = $this->repererEspace($nom['cultivar']);
1262
					$epithete_traite = $this->repererEspace($nom['cultivar']);
1400
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1263
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1401
				}
1264
				}
1402
			}
1265
			}
1403
		}
1266
		}
1404
		
1267
		
1405
		// Analyse des résultats
1268
		// Analyse des résultats
1406
		if (count($noms_erreur) > 0) {
1269
		if (count($noms_erreur) > 0) {
1407
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1270
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1408
			$info['message']['lignes'] = $noms_erreur;
1271
			$info['message']['lignes'] = $noms_erreur;
1409
		} else {
1272
		} else {
1410
			$info['resultat'] = true;
1273
			$info['resultat'] = true;
1411
		}
1274
		}
1412
		$noms_erreur = null;
1275
		$noms_erreur = null;
1413
		
1276
		
1414
		$this->traiterResultatTest($info);
1277
		$this->traiterResultatTest($info);
1415
	}
1278
	}
1416
	
1279
	
1417
	/**
1280
	/**
1418
	 * Test #40
1281
	 * Test #40
1419
	 */
1282
	 */
1420
	private function testerCultivarRang() {
1283
	private function testerCultivarRang() {
1421
		$info = $this->getInfosTest(40);
1284
		$info = $this->getInfosTest(40);
1422
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1285
		$info['nom'] = sprintf($info['nom'], $this->manuel['rang_genre']);
1423
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1286
		$info['description'] = sprintf($info['description'], $this->manuel['rang_genre']);
1424
		
1287
		
1425
		// Réalisation du test
1288
		// Réalisation du test
1426
		$noms_erreur = array();
1289
		$noms_erreur = array();
1427
		foreach ($this->noms as &$nom) {
1290
		foreach ($this->noms as &$nom) {
1428
			if ($nom['cultivar'] != '') {
1291
			if ($nom['cultivar'] != '') {
1429
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1292
				if ($nom['rang'] < $this->manuel['rang_genre']) {
1430
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1293
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci'], $nom['rang']);
1431
				}
1294
				}
1432
			}
1295
			}
1433
		}
1296
		}
1434
		
1297
		
1435
		// Analyse des résultats
1298
		// Analyse des résultats
1436
		if (count($noms_erreur) > 0) {
1299
		if (count($noms_erreur) > 0) {
1437
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1300
			$info['message']['entete'] = array('num_nom', 'nom_sci', 'rang erroné');
1438
			$info['message']['lignes'] = $noms_erreur;
1301
			$info['message']['lignes'] = $noms_erreur;
1439
		} else {
1302
		} else {
1440
			$info['resultat'] = true;
1303
			$info['resultat'] = true;
1441
		}
1304
		}
1442
		$noms_erreur = null;
1305
		$noms_erreur = null;
1443
		
1306
		
1444
		$this->traiterResultatTest($info);
1307
		$this->traiterResultatTest($info);
1445
	}
1308
	}
1446
	
1309
	
1447
	/**
1310
	/**
1448
	 * Test #41
1311
	 * Test #41
1449
	 */
1312
	 */
1450
	private function testerNomCommercialSyntaxe() {
1313
	private function testerNomCommercialSyntaxe() {
1451
		$info = $this->getInfosTest(41);
1314
		$info = $this->getInfosTest(41);
1452
		
1315
		
1453
		// Réalisation du test
1316
		// Réalisation du test
1454
		$noms_erreur = array();
1317
		$noms_erreur = array();
1455
		foreach ($this->noms as &$nom) {
1318
		foreach ($this->noms as &$nom) {
1456
			if ($nom['nom_commercial'] != '') {
1319
			if ($nom['nom_commercial'] != '') {
1457
				if (!$this->verifierNomCommercial($nom['nom_commercial'])) {
1320
				if (!$this->verifierNomCommercial($nom['nom_commercial'])) {
1458
					$epithete_traite = $this->repererEspace($nom['nom_commercial']);
1321
					$epithete_traite = $this->repererEspace($nom['nom_commercial']);
1459
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1322
					$noms_erreur[] = array($nom['num_nom'], $epithete_traite);
1460
				}
1323
				}
1461
			}
1324
			}
1462
		}
1325
		}
1463
		
1326
		
1464
		// Analyse des résultats
1327
		// Analyse des résultats
1465
		if (count($noms_erreur) > 0) {
1328
		if (count($noms_erreur) > 0) {
1466
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1329
			$info['message']['entete'] = array('num_nom', 'cultivar erroné');
1467
			$info['message']['lignes'] = $noms_erreur;
1330
			$info['message']['lignes'] = $noms_erreur;
1468
		} else {
1331
		} else {
1469
			$info['resultat'] = true;
1332
			$info['resultat'] = true;
1470
		}
1333
		}
1471
		$noms_erreur = null;
1334
		$noms_erreur = null;
1472
		
1335
		
1473
		$this->traiterResultatTest($info);
1336
		$this->traiterResultatTest($info);
1474
	}
1337
	}
1475
	
1338
	
1476
	/**
1339
	/**
1477
	 * Test #42
1340
	 * Test #42
1478
	 */
1341
	 */
1479
	private function testerNomCommercialPresenceCultivar() {
1342
	private function testerNomCommercialPresenceCultivar() {
1480
		$info = $this->getInfosTest(42);
1343
		$info = $this->getInfosTest(42);
1481
		
1344
		
1482
		// Réalisation du test
1345
		// Réalisation du test
1483
		$noms_erreur = array();
1346
		$noms_erreur = array();
1484
		foreach ($this->noms as &$nom) {
1347
		foreach ($this->noms as &$nom) {
1485
			if ((isset($nom['nom_commercial']) && $nom['nom_commercial'] != '') && ($nom['cultivar'] == '' && $nom['cultivar_groupe'] == '')) {
1348
			if ((isset($nom['nom_commercial']) && $nom['nom_commercial'] != '') && ($nom['cultivar'] == '' && $nom['cultivar_groupe'] == '')) {
1486
				$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1349
				$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1487
			}
1350
			}
1488
		}
1351
		}
1489
		
1352
		
1490
		// Analyse des résultats
1353
		// Analyse des résultats
1491
		if (count($noms_erreur) > 0) {
1354
		if (count($noms_erreur) > 0) {
1492
			$info['message']['entete'] = array('num_nom', 'nom_commercial sans cultivar ou cultivar_groupe');
1355
			$info['message']['entete'] = array('num_nom', 'nom_commercial sans cultivar ou cultivar_groupe');
1493
			$info['message']['lignes'] = $noms_erreur;
1356
			$info['message']['lignes'] = $noms_erreur;
1494
		} else {
1357
		} else {
1495
			$info['resultat'] = true;
1358
			$info['resultat'] = true;
1496
		}
1359
		}
1497
		$noms_erreur = null;
1360
		$noms_erreur = null;
1498
		
1361
		
1499
		$this->traiterResultatTest($info);
1362
		$this->traiterResultatTest($info);
1500
	}
1363
	}
1501
	
1364
	
1502
	/**
1365
	/**
1503
	 * Test #43
1366
	 * Test #43
1504
	 */
1367
	 */
1505
	private function testerAuteurSyntaxe() {
1368
	private function testerAuteurSyntaxe() {
1506
		$info = $this->getInfosTest(43);
1369
		$info = $this->getInfosTest(43);
1507
		
1370
		
1508
		// Réalisation du test
1371
		// Réalisation du test
1509
		$noms_erreur = array();
1372
		$noms_erreur = array();
1510
		foreach ($this->noms as &$nom) {
1373
		foreach ($this->noms as &$nom) {
1511
			if ($nom['auteur'] != '') {
1374
			if ($nom['auteur'] != '') {
1512
				if (!$this->verifierAuteur($nom['auteur'])) {
1375
				if (!$this->verifierAuteur($nom['auteur'])) {
1513
					$intitule_traite = $this->repererEspace($nom['auteur']);
1376
					$intitule_traite = $this->repererEspace($nom['auteur']);
1514
					$noms_erreur[] = array($nom['num_nom'], $intitule_traite);
1377
					$noms_erreur[] = array($nom['num_nom'], $intitule_traite);
1515
				}
1378
				}
1516
			}
1379
			}
1517
		}
1380
		}
1518
		
1381
		
1519
		// Analyse des résultats
1382
		// Analyse des résultats
1520
		if (count($noms_erreur) > 0) {
1383
		if (count($noms_erreur) > 0) {
1521
			$info['message']['entete'] = array('num_nom', 'auteur erroné');
1384
			$info['message']['entete'] = array('num_nom', 'auteur erroné');
1522
			$info['message']['lignes'] = $noms_erreur;
1385
			$info['message']['lignes'] = $noms_erreur;
1523
		} else {
1386
		} else {
1524
			$info['resultat'] = true;
1387
			$info['resultat'] = true;
1525
		}
1388
		}
1526
		$noms_erreur = null;
1389
		$noms_erreur = null;
1527
		
1390
		
1528
		$this->traiterResultatTest($info);
1391
		$this->traiterResultatTest($info);
1529
	}
1392
	}
1530
	
1393
	
1531
	/**
1394
	/**
1532
	 * Test #44
1395
	 * Test #44
1533
	 */
1396
	 */
1534
	private function testerAnneeSyntaxe() {
1397
	private function testerAnneeSyntaxe() {
1535
		$info = $this->getInfosTest(44);
1398
		$info = $this->getInfosTest(44);
1536
		
1399
		
1537
		// Réalisation du test
1400
		// Réalisation du test
1538
		$noms_erreur = array();
1401
		$noms_erreur = array();
1539
		foreach ($this->noms as &$nom) {
1402
		foreach ($this->noms as &$nom) {
1540
			if ($nom['annee'] != '') {
1403
			if ($nom['annee'] != '') {
1541
				if (!$this->verifierAnnee($nom['annee'])) {
1404
				if (!$this->verifierAnnee($nom['annee'])) {
1542
					$noms_erreur[] = array($nom['num_nom'], $nom['annee']);
1405
					$noms_erreur[] = array($nom['num_nom'], $nom['annee']);
1543
				}
1406
				}
1544
			}
1407
			}
1545
		}
1408
		}
1546
		
1409
		
1547
		// Analyse des résultats
1410
		// Analyse des résultats
1548
		if (count($noms_erreur) > 0) {
1411
		if (count($noms_erreur) > 0) {
1549
			$info['message']['entete'] = array('num_nom', 'annee erronée');
1412
			$info['message']['entete'] = array('num_nom', 'annee erronée');
1550
			$info['message']['lignes'] = $noms_erreur;
1413
			$info['message']['lignes'] = $noms_erreur;
1551
		} else {
1414
		} else {
1552
			$info['resultat'] = true;
1415
			$info['resultat'] = true;
1553
		}
1416
		}
1554
		$noms_erreur = null;
1417
		$noms_erreur = null;
1555
		
1418
		
1556
		$this->traiterResultatTest($info);
1419
		$this->traiterResultatTest($info);
1557
	}
1420
	}
1558
	
1421
	
1559
	/**
1422
	/**
1560
	 * Test #45
1423
	 * Test #45
1561
	 */
1424
	 */
1562
	private function testerBiblioOrigineSyntaxe() {
1425
	private function testerBiblioOrigineSyntaxe() {
1563
		$info = $this->getInfosTest(45);
1426
		$info = $this->getInfosTest(45);
1564
		
1427
		
1565
		// Réalisation du test
1428
		// Réalisation du test
1566
		$noms_erreur = array();
1429
		$noms_erreur = array();
1567
		foreach ($this->noms as &$nom) {
1430
		foreach ($this->noms as &$nom) {
1568
			if ($nom['biblio_origine'] != '') {
1431
			if ($nom['biblio_origine'] != '') {
1569
				if (!$this->verifierBiblioOrigine($nom['biblio_origine'])) {
1432
				if (!$this->verifierBiblioOrigine($nom['biblio_origine'])) {
1570
					$biblio_traite = $this->repererEspace($nom['biblio_origine']);
1433
					$biblio_traite = $this->repererEspace($nom['biblio_origine']);
1571
					$noms_erreur[] = array($nom['num_nom'], $biblio_traite);
1434
					$noms_erreur[] = array($nom['num_nom'], $biblio_traite);
1572
				}
1435
				}
1573
			}
1436
			}
1574
		}
1437
		}
1575
		
1438
		
1576
		// Analyse des résultats
1439
		// Analyse des résultats
1577
		if (count($noms_erreur) > 0) {
1440
		if (count($noms_erreur) > 0) {
1578
			$info['message']['entete'] = array('num_nom', 'biblio_origine erroné');
1441
			$info['message']['entete'] = array('num_nom', 'biblio_origine erroné');
1579
			$info['message']['lignes'] = $noms_erreur;
1442
			$info['message']['lignes'] = $noms_erreur;
1580
		} else {
1443
		} else {
1581
			$info['resultat'] = true;
1444
			$info['resultat'] = true;
1582
		}
1445
		}
1583
		$noms_erreur = null;
1446
		$noms_erreur = null;
1584
		
1447
		
1585
		$this->traiterResultatTest($info);
1448
		$this->traiterResultatTest($info);
1586
	}
1449
	}
1587
	
1450
	
1588
	/**
1451
	/**
1589
	 * Test #46
1452
	 * Test #46
1590
	 */
1453
	 */
1591
	private function testerHomonymieSyntaxe() {
1454
	private function testerHomonymieSyntaxe() {
1592
		$info = $this->getInfosTest(46);
1455
		$info = $this->getInfosTest(46);
1593
		
1456
		
1594
		// Réalisation du test
1457
		// Réalisation du test
1595
		$noms_erreur = array();
1458
		$noms_erreur = array();
1596
		foreach ($this->noms as &$nom) {
1459
		foreach ($this->noms as &$nom) {
1597
			if ($nom['homonyme'] != '') {
1460
			if ($nom['homonyme'] != '') {
1598
				if (!$this->verifierBooleen($nom['homonyme'])) {
1461
				if (!$this->verifierBooleen($nom['homonyme'])) {
1599
					$noms_erreur[] = array($nom['num_nom'], $nom['homonyme']);
1462
					$noms_erreur[] = array($nom['num_nom'], $nom['homonyme']);
1600
				}
1463
				}
1601
			}
1464
			}
1602
		}
1465
		}
1603
		
1466
		
1604
		// Analyse des résultats
1467
		// Analyse des résultats
1605
		if (count($noms_erreur) > 0) {
1468
		if (count($noms_erreur) > 0) {
1606
			$info['message']['entete'] = array('num_nom', 'homonyme erroné');
1469
			$info['message']['entete'] = array('num_nom', 'homonyme erroné');
1607
			$info['message']['lignes'] = $noms_erreur;
1470
			$info['message']['lignes'] = $noms_erreur;
1608
		} else {
1471
		} else {
1609
			$info['resultat'] = true;
1472
			$info['resultat'] = true;
1610
		}
1473
		}
1611
		$noms_erreur = null;
1474
		$noms_erreur = null;
1612
		
1475
		
1613
		$this->traiterResultatTest($info);
1476
		$this->traiterResultatTest($info);
1614
	}
1477
	}
1615
	
1478
	
1616
	/**
1479
	/**
1617
	 * Test #47
1480
	 * Test #47
1618
	 */
1481
	 */
1619
	private function testerHomonymieExistence() {
1482
	private function testerHomonymieExistence() {
1620
		$info = $this->getInfosTest(47);
1483
		$info = $this->getInfosTest(47);
1621
		
1484
		
1622
		$noms_homonymie = $this->classerNomsParNomComplet();
1485
		$noms_homonymie = $this->classerNomsParNomComplet();
1623
		
1486
		
1624
		// Réalisation du test
1487
		// Réalisation du test
1625
		$noms_erreur = array();
1488
		$noms_erreur = array();
1626
		foreach ($this->noms as &$nom) {
1489
		foreach ($this->noms as &$nom) {
1627
			if ($nom['homonyme'] != '0' && $nom['homonyme'] != '') {
1490
			if ($nom['homonyme'] != '0' && $nom['homonyme'] != '') {
1628
				if ($noms_homonymie[$nom['nom_sci']] <= 1) {
1491
				if ($noms_homonymie[$nom['nom_sci']] <= 1) {
1629
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1492
					$noms_erreur[] = array($nom['num_nom'], $nom['nom_sci']);
1630
				}
1493
				}
1631
			}
1494
			}
1632
		}
1495
		}
1633
		$noms_homonymie = null;
1496
		$noms_homonymie = null;
1634
		
1497
		
1635
		// Analyse des résultats
1498
		// Analyse des résultats
1636
		if (count($noms_erreur) > 0) {
1499
		if (count($noms_erreur) > 0) {
1637
			$info['message']['entete'] = array('num_nom', 'homonyme introuvable');
1500
			$info['message']['entete'] = array('num_nom', 'homonyme introuvable');
1638
			$info['message']['lignes'] = $noms_erreur;
1501
			$info['message']['lignes'] = $noms_erreur;
1639
		} else {
1502
		} else {
1640
			$info['resultat'] = true;
1503
			$info['resultat'] = true;
1641
		}
1504
		}
1642
		$noms_erreur = null;
1505
		$noms_erreur = null;
1643
		
1506
		
1644
		$this->traiterResultatTest($info);
1507
		$this->traiterResultatTest($info);
1645
	}
1508
	}
1646
	
1509
	
1647
	/**
1510
	/**
1648
	 * Test #48
1511
	 * Test #48
1649
	 */
1512
	 */
1650
	private function testerBasionymeSyntaxe() {
1513
	private function testerBasionymeSyntaxe() {
1651
		$info = $this->getInfosTest(48);
1514
		$info = $this->getInfosTest(48);
1652
		
1515
		
1653
		// Réalisation du test
1516
		// Réalisation du test
1654
		$noms_erreur = array();
1517
		$noms_erreur = array();
1655
		foreach ($this->noms as &$nom) {
1518
		foreach ($this->noms as &$nom) {
1656
			if ($nom['basionyme'] != '') {
1519
			if ($nom['basionyme'] != '') {
1657
				if (!$this->verifierNombre($nom['basionyme'])) {
1520
				if (!$this->verifierNombre($nom['basionyme'])) {
1658
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1521
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1659
				}
1522
				}
1660
			}
1523
			}
1661
		}
1524
		}
1662
		
1525
		
1663
		// Analyse des résultats
1526
		// Analyse des résultats
1664
		if (count($noms_erreur) > 0) {
1527
		if (count($noms_erreur) > 0) {
1665
			$info['message']['entete'] = array('num_nom', 'basionyme erroné');
1528
			$info['message']['entete'] = array('num_nom', 'basionyme erroné');
1666
			$info['message']['lignes'] = $noms_erreur;
1529
			$info['message']['lignes'] = $noms_erreur;
1667
		} else {
1530
		} else {
1668
			$info['resultat'] = true;
1531
			$info['resultat'] = true;
1669
		}
1532
		}
1670
		$noms_erreur = null;
1533
		$noms_erreur = null;
1671
		
1534
		
1672
		$this->traiterResultatTest($info);
1535
		$this->traiterResultatTest($info);
1673
	}
1536
	}
1674
 
1537
 
1675
	/**
1538
	/**
1676
	 * Test #49
1539
	 * Test #49
1677
	 */
1540
	 */
1678
	private function testerBasionymeExistence() {
1541
	private function testerBasionymeExistence() {
1679
		$info = $this->getInfosTest(49);
1542
		$info = $this->getInfosTest(49);
1680
		
1543
		
1681
		// Réalisation du test
1544
		// Réalisation du test
1682
		$noms_erreur = array();
1545
		$noms_erreur = array();
1683
		foreach ($this->noms as &$nom) {
1546
		foreach ($this->noms as &$nom) {
1684
			if ($nom['basionyme'] != '') {
1547
			if ($nom['basionyme'] != '') {
1685
				if (!isset($this->noms[$nom['basionyme']])) {
1548
				if (!isset($this->noms[$nom['basionyme']])) {
1686
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1549
					$noms_erreur[] = array($nom['num_nom'], $nom['basionyme']);
1687
				}
1550
				}
1688
			}
1551
			}
1689
		}
1552
		}
1690
		
1553
		
1691
		// Analyse des résultats
1554
		// Analyse des résultats
1692
		if (count($noms_erreur) > 0) {
1555
		if (count($noms_erreur) > 0) {
1693
			$info['message']['entete'] = array('num_nom', 'basionyme introuvable');
1556
			$info['message']['entete'] = array('num_nom', 'basionyme introuvable');
1694
			$info['message']['lignes'] = $noms_erreur;
1557
			$info['message']['lignes'] = $noms_erreur;
1695
		} else {
1558
		} else {
1696
			$info['resultat'] = true;
1559
			$info['resultat'] = true;
1697
		}
1560
		}
1698
		$noms_erreur = null;
1561
		$noms_erreur = null;
1699
		
1562
		
1700
		$this->traiterResultatTest($info);
1563
		$this->traiterResultatTest($info);
1701
	}
1564
	}
1702
	
1565
	
1703
	/**
1566
	/**
1704
	 * Test #50
1567
	 * Test #50
1705
	 */
1568
	 */
1706
	private function testerSynonymeProparteSyntaxe() {
1569
	private function testerSynonymeProparteSyntaxe() {
1707
		$info = $this->getInfosTest(50);
1570
		$info = $this->getInfosTest(50);
1708
		
1571
		
1709
		// Réalisation du test
1572
		// Réalisation du test
1710
		$noms_erreur = array();
1573
		$noms_erreur = array();
1711
		foreach ($this->noms as &$nom) {
1574
		foreach ($this->noms as &$nom) {
1712
			if ($nom['synonyme_proparte'] != '') {
1575
			if ($nom['synonyme_proparte'] != '') {
1713
				if (!$this->verifierNombreSuite($nom['synonyme_proparte'])) {
1576
				if (!$this->verifierNombreSuite($nom['synonyme_proparte'])) {
1714
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_proparte']);
1577
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_proparte']);
1715
				}
1578
				}
1716
			}
1579
			}
1717
		}
1580
		}
1718
		
1581
		
1719
		// Analyse des résultats
1582
		// Analyse des résultats
1720
		if (count($noms_erreur) > 0) {
1583
		if (count($noms_erreur) > 0) {
1721
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte erroné');
1584
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte erroné');
1722
			$info['message']['lignes'] = $noms_erreur;
1585
			$info['message']['lignes'] = $noms_erreur;
1723
		} else {
1586
		} else {
1724
			$info['resultat'] = true;
1587
			$info['resultat'] = true;
1725
		}
1588
		}
1726
		$noms_erreur = null;
1589
		$noms_erreur = null;
1727
		
1590
		
1728
		$this->traiterResultatTest($info);
1591
		$this->traiterResultatTest($info);
1729
	}
1592
	}
1730
	
1593
	
1731
	/**
1594
	/**
1732
	 * Test #51
1595
	 * Test #51
1733
	 */
1596
	 */
1734
	private function testerSynonymeProparteExistence() {
1597
	private function testerSynonymeProparteExistence() {
1735
		$info = $this->getInfosTest(51);
1598
		$info = $this->getInfosTest(51);
1736
		
1599
		
1737
		// Réalisation du test
1600
		// Réalisation du test
1738
		$noms_erreur = array();
1601
		$noms_erreur = array();
1739
		foreach ($this->noms as &$nom) {
1602
		foreach ($this->noms as &$nom) {
1740
			if ($nom['synonyme_proparte'] != '') {
1603
			if ($nom['synonyme_proparte'] != '') {
1741
				$num_nom_a_verifier = explode(',', $nom['synonyme_proparte']);
1604
				$num_nom_a_verifier = explode(',', $nom['synonyme_proparte']);
1742
				$num_nom_en_erreur = array();
1605
				$num_nom_en_erreur = array();
1743
				foreach ($num_nom_a_verifier as $num_nom) {
1606
				foreach ($num_nom_a_verifier as $num_nom) {
1744
					if (!isset($this->noms[$num_nom])) {
1607
					if (!isset($this->noms[$num_nom])) {
1745
						$num_nom_en_erreur[] = $num_nom;
1608
						$num_nom_en_erreur[] = $num_nom;
1746
					}
1609
					}
1747
				}
1610
				}
1748
				if (count($nbre_en_erreur) > 0) {
1611
				if (count($nbre_en_erreur) > 0) {
1749
					$noms_erreur[] = array($nom['num_nom'], implode(',', $num_nom_en_erreur));
1612
					$noms_erreur[] = array($nom['num_nom'], implode(',', $num_nom_en_erreur));
1750
				}
1613
				}
1751
			}
1614
			}
1752
		}
1615
		}
1753
		
1616
		
1754
		// Analyse des résultats
1617
		// Analyse des résultats
1755
		if (count($noms_erreur) > 0) {
1618
		if (count($noms_erreur) > 0) {
1756
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte introuvable');
1619
			$info['message']['entete'] = array('num_nom', 'synonyme_proparte introuvable');
1757
			$info['message']['lignes'] = $noms_erreur;
1620
			$info['message']['lignes'] = $noms_erreur;
1758
		} else {
1621
		} else {
1759
			$info['resultat'] = true;
1622
			$info['resultat'] = true;
1760
		}
1623
		}
1761
		$noms_erreur = null;
1624
		$noms_erreur = null;
1762
		
1625
		
1763
		$this->traiterResultatTest($info);
1626
		$this->traiterResultatTest($info);
1764
	}
1627
	}
1765
	
1628
	
1766
	/**
1629
	/**
1767
	 * Test #52
1630
	 * Test #52
1768
	 */
1631
	 */
1769
	private function testerSynonymeDouteuxSyntaxe() {
1632
	private function testerSynonymeDouteuxSyntaxe() {
1770
		$info = $this->getInfosTest(52);
1633
		$info = $this->getInfosTest(52);
1771
		
1634
		
1772
		// Réalisation du test
1635
		// Réalisation du test
1773
		$noms_erreur = array();
1636
		$noms_erreur = array();
1774
		foreach ($this->noms as &$nom) {
1637
		foreach ($this->noms as &$nom) {
1775
			if ($nom['synonyme_douteux'] != '') {
1638
			if ($nom['synonyme_douteux'] != '') {
1776
				if (!$this->verifierBooleen($nom['synonyme_douteux'])) {
1639
				if (!$this->verifierBooleen($nom['synonyme_douteux'])) {
1777
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux']);
1640
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux']);
1778
				}
1641
				}
1779
			}
1642
			}
1780
		}
1643
		}
1781
		
1644
		
1782
		// Analyse des résultats
1645
		// Analyse des résultats
1783
		if (count($noms_erreur) > 0) {
1646
		if (count($noms_erreur) > 0) {
1784
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux erroné');
1647
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux erroné');
1785
			$info['message']['lignes'] = $noms_erreur;
1648
			$info['message']['lignes'] = $noms_erreur;
1786
		} else {
1649
		} else {
1787
			$info['resultat'] = true;
1650
			$info['resultat'] = true;
1788
		}
1651
		}
1789
		$noms_erreur = null;
1652
		$noms_erreur = null;
1790
		
1653
		
1791
		$this->traiterResultatTest($info);
1654
		$this->traiterResultatTest($info);
1792
	}
1655
	}
1793
	
1656
	
1794
	/**
1657
	/**
1795
	 * Test #53
1658
	 * Test #53
1796
	 */
1659
	 */
1797
	private function testerSynonymeDouteuxNumNomRetenu() {
1660
	private function testerSynonymeDouteuxNumNomRetenu() {
1798
		$info = $this->getInfosTest(53);
1661
		$info = $this->getInfosTest(53);
1799
		
1662
		
1800
		// Réalisation du test
1663
		// Réalisation du test
1801
		$noms_erreur = array();
1664
		$noms_erreur = array();
1802
		foreach ($this->noms as &$nom) {
1665
		foreach ($this->noms as &$nom) {
1803
			if ($nom['synonyme_douteux'] == 1 && $nom['num_nom_retenu'] != ' ') {
1666
			if ($nom['synonyme_douteux'] == 1 && $nom['num_nom_retenu'] != ' ') {
1804
				$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux'], $nom['num_nom_retenu']);
1667
				$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_douteux'], $nom['num_nom_retenu']);
1805
			}
1668
			}
1806
		}
1669
		}
1807
		
1670
		
1808
		// Analyse des résultats
1671
		// Analyse des résultats
1809
		if (count($noms_erreur) > 0) {
1672
		if (count($noms_erreur) > 0) {
1810
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux', 'num_nom_retenu');
1673
			$info['message']['entete'] = array('num_nom', 'synonyme_douteux', 'num_nom_retenu');
1811
			$info['message']['lignes'] = $noms_erreur;
1674
			$info['message']['lignes'] = $noms_erreur;
1812
		} else {
1675
		} else {
1813
			$info['resultat'] = true;
1676
			$info['resultat'] = true;
1814
		}
1677
		}
1815
		$noms_erreur = null;
1678
		$noms_erreur = null;
1816
		$this->traiterResultatTest($info);
1679
		$this->traiterResultatTest($info);
1817
	}
1680
	}
1818
	
1681
	
1819
	/**
1682
	/**
1820
	 * Test #54
1683
	 * Test #54
1821
	 */
1684
	 */
1822
	private function testerSynonymeMalAppliqueSyntaxe() {
1685
	private function testerSynonymeMalAppliqueSyntaxe() {
1823
		$info = $this->getInfosTest(54);
1686
		$info = $this->getInfosTest(54);
1824
		
1687
		
1825
		// Réalisation du test
1688
		// Réalisation du test
1826
		$noms_erreur = array();
1689
		$noms_erreur = array();
1827
		foreach ($this->noms as &$nom) {
1690
		foreach ($this->noms as &$nom) {
1828
			if ($nom['synonyme_mal_applique'] != '') {
1691
			if ($nom['synonyme_mal_applique'] != '') {
1829
				if (!$this->verifierBooleen($nom['synonyme_mal_applique'])) {
1692
				if (!$this->verifierBooleen($nom['synonyme_mal_applique'])) {
1830
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_mal_applique']);
1693
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_mal_applique']);
1831
				}
1694
				}
1832
			}
1695
			}
1833
		}
1696
		}
1834
		
1697
		
1835
		// Analyse des résultats
1698
		// Analyse des résultats
1836
		if (count($noms_erreur) > 0) {
1699
		if (count($noms_erreur) > 0) {
1837
			$info['message']['entete'] = array('num_nom', 'synonyme_mal_applique erroné');
1700
			$info['message']['entete'] = array('num_nom', 'synonyme_mal_applique erroné');
1838
			$info['message']['lignes'] = $noms_erreur;
1701
			$info['message']['lignes'] = $noms_erreur;
1839
		} else {
1702
		} else {
1840
			$info['resultat'] = true;
1703
			$info['resultat'] = true;
1841
		}
1704
		}
1842
		$noms_erreur = null;
1705
		$noms_erreur = null;
1843
		
1706
		
1844
		$this->traiterResultatTest($info);
1707
		$this->traiterResultatTest($info);
1845
	}
1708
	}
1846
	
1709
	
1847
	/**
1710
	/**
1848
	 * Test #55
1711
	 * Test #55
1849
	 */
1712
	 */
1850
	private function testerSynonymeOrthographiqueSyntaxe() {
1713
	private function testerSynonymeOrthographiqueSyntaxe() {
1851
		$info = $this->getInfosTest(55);
1714
		$info = $this->getInfosTest(55);
1852
		
1715
		
1853
		// Réalisation du test
1716
		// Réalisation du test
1854
		$noms_erreur = array();
1717
		$noms_erreur = array();
1855
		foreach ($this->noms as $nom) {
1718
		foreach ($this->noms as $nom) {
1856
			if ($nom['synonyme_orthographique'] != '') {
1719
			if ($nom['synonyme_orthographique'] != '') {
1857
				if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
1720
				if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
1858
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1721
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1859
				}
1722
				}
1860
			}
1723
			}
1861
		}
1724
		}
1862
		
1725
		
1863
		// Analyse des résultats
1726
		// Analyse des résultats
1864
		if (count($noms_erreur) > 0) {
1727
		if (count($noms_erreur) > 0) {
1865
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
1728
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
1866
			$info['message']['lignes'] = $noms_erreur;
1729
			$info['message']['lignes'] = $noms_erreur;
1867
		} else {
1730
		} else {
1868
			$info['resultat'] = true;
1731
			$info['resultat'] = true;
1869
		}
1732
		}
1870
		$noms_erreur = null;
1733
		$noms_erreur = null;
1871
		
1734
		
1872
		$this->traiterResultatTest($info);
1735
		$this->traiterResultatTest($info);
1873
	}
1736
	}
1874
	
1737
	
1875
	/**
1738
	/**
1876
	 * Test #56
1739
	 * Test #56
1877
	 */
1740
	 */
1878
	private function testerSynonymeOrthographiqueExistence() {
1741
	private function testerSynonymeOrthographiqueExistence() {
1879
		$info = $this->getInfosTest(56);
1742
		$info = $this->getInfosTest(56);
1880
		
1743
		
1881
		// Réalisation du test
1744
		// Réalisation du test
1882
		$noms_erreur = array();
1745
		$noms_erreur = array();
1883
		foreach ($this->noms as &$nom) {
1746
		foreach ($this->noms as &$nom) {
1884
			if ($nom['synonyme_orthographique'] != '') {
1747
			if ($nom['synonyme_orthographique'] != '') {
1885
				if (!isset($this->noms[$nom['synonyme_orthographique']])) {
1748
				if (!isset($this->noms[$nom['synonyme_orthographique']])) {
1886
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1749
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
1887
				}
1750
				}
1888
			}
1751
			}
1889
		}
1752
		}
1890
		
1753
		
1891
		// Analyse des résultats
1754
		// Analyse des résultats
1892
		if (count($noms_erreur) > 0) {
1755
		if (count($noms_erreur) > 0) {
1893
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
1756
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
1894
			$info['message']['lignes'] = $noms_erreur;
1757
			$info['message']['lignes'] = $noms_erreur;
1895
		} else {
1758
		} else {
1896
			$info['resultat'] = true;
1759
			$info['resultat'] = true;
1897
		}
1760
		}
1898
		$noms_erreur = null;
1761
		$noms_erreur = null;
1899
		
1762
		
1900
		$this->traiterResultatTest($info);
1763
		$this->traiterResultatTest($info);
1901
	}
1764
	}
1902
	
1765
	
1903
	/**
1766
	/**
1904
	 * Test #57
1767
	 * Test #57
1905
	 */
1768
	 */
1906
	private function testerHybrideParent01Syntaxe() {
1769
	private function testerHybrideParent01Syntaxe() {
1907
		$info = $this->getInfosTest(57);
1770
		$info = $this->getInfosTest(57);
1908
		
1771
		
1909
		// Réalisation du test
1772
		// Réalisation du test
1910
		$noms_erreur = array();
1773
		$noms_erreur = array();
1911
		foreach ($this->noms as &$nom) {
1774
		foreach ($this->noms as &$nom) {
1912
			if ($nom['hybride_parent_01'] != '') {
1775
			if ($nom['hybride_parent_01'] != '') {
1913
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
1776
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
1914
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1777
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1915
				}
1778
				}
1916
			}
1779
			}
1917
		}
1780
		}
1918
		
1781
		
1919
		// Analyse des résultats
1782
		// Analyse des résultats
1920
		if (count($noms_erreur) > 0) {
1783
		if (count($noms_erreur) > 0) {
1921
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
1784
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
1922
			$info['message']['lignes'] = $noms_erreur;
1785
			$info['message']['lignes'] = $noms_erreur;
1923
		} else {
1786
		} else {
1924
			$info['resultat'] = true;
1787
			$info['resultat'] = true;
1925
		}
1788
		}
1926
		$noms_erreur = null;
1789
		$noms_erreur = null;
1927
		
1790
		
1928
		$this->traiterResultatTest($info);
1791
		$this->traiterResultatTest($info);
1929
	}
1792
	}
1930
	
1793
	
1931
	/**
1794
	/**
1932
	 * Test #58
1795
	 * Test #58
1933
	 */
1796
	 */
1934
	private function testerHybrideParent01Existence() {
1797
	private function testerHybrideParent01Existence() {
1935
		$info = $this->getInfosTest(58);
1798
		$info = $this->getInfosTest(58);
1936
		
1799
		
1937
		// Réalisation du test
1800
		// Réalisation du test
1938
		$noms_erreur = array();
1801
		$noms_erreur = array();
1939
		foreach ($this->noms as &$nom) {
1802
		foreach ($this->noms as &$nom) {
1940
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
1803
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
1941
				if (!isset($this->noms[$nom['hybride_parent_01']])) {
1804
				if (!isset($this->noms[$nom['hybride_parent_01']])) {
1942
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1805
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_01']));
1943
				}
1806
				}
1944
			}
1807
			}
1945
		}
1808
		}
1946
		
1809
		
1947
		// Analyse des résultats
1810
		// Analyse des résultats
1948
		if (count($noms_erreur) > 0) {
1811
		if (count($noms_erreur) > 0) {
1949
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
1812
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
1950
			$info['message']['lignes'] = $noms_erreur;
1813
			$info['message']['lignes'] = $noms_erreur;
1951
		} else {
1814
		} else {
1952
			$info['resultat'] = true;
1815
			$info['resultat'] = true;
1953
		}
1816
		}
1954
		$noms_erreur = null;
1817
		$noms_erreur = null;
1955
		
1818
		
1956
		$this->traiterResultatTest($info);
1819
		$this->traiterResultatTest($info);
1957
	}
1820
	}
1958
	
1821
	
1959
	/**
1822
	/**
1960
	 * Test #59
1823
	 * Test #59
1961
	 */
1824
	 */
1962
	private function testerHybrideParent02Syntaxe() {
1825
	private function testerHybrideParent02Syntaxe() {
1963
		$info = $this->getInfosTest(59);
1826
		$info = $this->getInfosTest(59);
1964
		
1827
		
1965
		// Réalisation du test
1828
		// Réalisation du test
1966
		$noms_erreur = array();
1829
		$noms_erreur = array();
1967
		foreach ($this->noms as &$nom) {
1830
		foreach ($this->noms as &$nom) {
1968
			if ($nom['hybride_parent_02'] != '') {
1831
			if ($nom['hybride_parent_02'] != '') {
1969
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
1832
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
1970
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
1833
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
1971
				}
1834
				}
1972
			}
1835
			}
1973
		}
1836
		}
1974
		
1837
		
1975
		// Analyse des résultats
1838
		// Analyse des résultats
1976
		if (count($noms_erreur) > 0) {
1839
		if (count($noms_erreur) > 0) {
1977
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
1840
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
1978
			$info['message']['lignes'] = $noms_erreur;
1841
			$info['message']['lignes'] = $noms_erreur;
1979
		} else {
1842
		} else {
1980
			$info['resultat'] = true;
1843
			$info['resultat'] = true;
1981
		}
1844
		}
1982
		$noms_erreur = null;
1845
		$noms_erreur = null;
1983
		
1846
		
1984
		$this->traiterResultatTest($info);
1847
		$this->traiterResultatTest($info);
1985
	}
1848
	}
1986
	
1849
	
1987
	/**
1850
	/**
1988
	 * Test #60
1851
	 * Test #60
1989
	 */
1852
	 */
1990
	private function testerHybrideParent02Existence() {
1853
	private function testerHybrideParent02Existence() {
1991
		$info = $this->getInfosTest(60);
1854
		$info = $this->getInfosTest(60);
1992
		
1855
		
1993
		// Réalisation du test
1856
		// Réalisation du test
1994
		$noms_erreur = array();
1857
		$noms_erreur = array();
1995
		foreach ($this->noms as &$nom) {
1858
		foreach ($this->noms as &$nom) {
1996
			if ($nom['hybride_parent_02'] != '') {
1859
			if ($nom['hybride_parent_02'] != '') {
1997
				if (!isset($this->noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
1860
				if (!isset($this->noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
1998
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
1861
					$noms_erreur[] = array($nom['num_nom'], $this->repererEspace($nom['hybride_parent_02']));
1999
				}
1862
				}
2000
			}
1863
			}
2001
		}
1864
		}
2002
		
1865
		
2003
		// Analyse des résultats
1866
		// Analyse des résultats
2004
		if (count($noms_erreur) > 0) {
1867
		if (count($noms_erreur) > 0) {
2005
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
1868
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
2006
			$info['message']['lignes'] = $noms_erreur;
1869
			$info['message']['lignes'] = $noms_erreur;
2007
		} else {
1870
		} else {
2008
			$info['resultat'] = true;
1871
			$info['resultat'] = true;
2009
		}
1872
		}
2010
		$noms_erreur = null;
1873
		$noms_erreur = null;
2011
		
1874
		
2012
		$this->traiterResultatTest($info);
1875
		$this->traiterResultatTest($info);
2013
	}
1876
	}
2014
	
1877
	
2015
	/**
1878
	/**
2016
	 * Test #61
1879
	 * Test #61
2017
	 */
1880
	 */
2018
	private function testerPresenceSyntaxe() {
1881
	private function testerPresenceSyntaxe() {
2019
		$info = $this->getInfosTest(61);
1882
		$info = $this->getInfosTest(61);
2020
		
1883
		
2021
		// Réalisation du test
1884
		// Réalisation du test
2022
		$noms_erreur = array();
1885
		$noms_erreur = array();
2023
		foreach ($this->noms as &$nom) {
1886
		foreach ($this->noms as &$nom) {
2024
			if ($nom['presence'] != '') {
1887
			if ($nom['presence'] != '') {
2025
				if (!$this->verifierPresence($nom['presence'])) {
1888
				if (!$this->verifierPresence($nom['presence'])) {
2026
					$noms_erreur[] = array($nom['num_nom'], $nom['presence']);
1889
					$noms_erreur[] = array($nom['num_nom'], $nom['presence']);
2027
				}
1890
				}
2028
			}
1891
			}
2029
		}
1892
		}
2030
		
1893
		
2031
		// Analyse des résultats
1894
		// Analyse des résultats
2032
		if (count($noms_erreur) > 0) {
1895
		if (count($noms_erreur) > 0) {
2033
			$info['message']['entete'] = array('num_nom', 'presence erroné');
1896
			$info['message']['entete'] = array('num_nom', 'presence erroné');
2034
			$info['message']['lignes'] = $noms_erreur;
1897
			$info['message']['lignes'] = $noms_erreur;
2035
		} else {
1898
		} else {
2036
			$info['resultat'] = true;
1899
			$info['resultat'] = true;
2037
		}
1900
		}
2038
		$noms_erreur = null;
1901
		$noms_erreur = null;
2039
		
1902
		
2040
		$this->traiterResultatTest($info);
1903
		$this->traiterResultatTest($info);
2041
	}
1904
	}
2042
	
1905
	
2043
	/**
1906
	/**
2044
	 * Test #62
1907
	 * Test #62
2045
	 */
1908
	 */
2046
	private function testerStatutOrigineSyntaxe() {
1909
	private function testerStatutOrigineSyntaxe() {
2047
		$info = $this->getInfosTest(62);
1910
		$info = $this->getInfosTest(62);
2048
		
1911
		
2049
		// Réalisation du test
1912
		// Réalisation du test
2050
		$noms_erreur = array();
1913
		$noms_erreur = array();
2051
		foreach ($this->noms as &$nom) {
1914
		foreach ($this->noms as &$nom) {
2052
			if ($nom['statut_origine'] != '') {
1915
			if ($nom['statut_origine'] != '') {
2053
				if (!$this->verifierStatutOrigine($nom['statut_origine'])) {
1916
				if (!$this->verifierStatutOrigine($nom['statut_origine'])) {
2054
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_origine']);
1917
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_origine']);
2055
				}
1918
				}
2056
			}
1919
			}
2057
		}
1920
		}
2058
		
1921
		
2059
		// Analyse des résultats
1922
		// Analyse des résultats
2060
		if (count($noms_erreur) > 0) {
1923
		if (count($noms_erreur) > 0) {
2061
			$info['message']['entete'] = array('num_nom', 'statut_origine erroné');
1924
			$info['message']['entete'] = array('num_nom', 'statut_origine erroné');
2062
			$info['message']['lignes'] = $noms_erreur;
1925
			$info['message']['lignes'] = $noms_erreur;
2063
		} else {
1926
		} else {
2064
			$info['resultat'] = true;
1927
			$info['resultat'] = true;
2065
		}
1928
		}
2066
		$noms_erreur = null;
1929
		$noms_erreur = null;
2067
		
1930
		
2068
		$this->traiterResultatTest($info);
1931
		$this->traiterResultatTest($info);
2069
	}
1932
	}
2070
	
1933
	
2071
	/**
1934
	/**
2072
	 * Test #63
1935
	 * Test #63
2073
	 */
1936
	 */
2074
	private function testerStatutIntroductionSyntaxe() {
1937
	private function testerStatutIntroductionSyntaxe() {
2075
		$info = $this->getInfosTest(63);
1938
		$info = $this->getInfosTest(63);
2076
		
1939
		
2077
		// Réalisation du test
1940
		// Réalisation du test
2078
		$noms_erreur = array();
1941
		$noms_erreur = array();
2079
		foreach ($this->noms as &$nom) {
1942
		foreach ($this->noms as &$nom) {
2080
			if ($nom['statut_introduction'] != '') {
1943
			if ($nom['statut_introduction'] != '') {
2081
				if (!$this->verifierStatutIntroduction($nom['statut_introduction'])) {
1944
				if (!$this->verifierStatutIntroduction($nom['statut_introduction'])) {
2082
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_introduction']);
1945
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_introduction']);
2083
				}
1946
				}
2084
			}
1947
			}
2085
		}
1948
		}
2086
		
1949
		
2087
		// Analyse des résultats
1950
		// Analyse des résultats
2088
		if (count($noms_erreur) > 0) {
1951
		if (count($noms_erreur) > 0) {
2089
			$info['message']['entete'] = array('num_nom', 'statut_introduction erroné');
1952
			$info['message']['entete'] = array('num_nom', 'statut_introduction erroné');
2090
			$info['message']['lignes'] = $noms_erreur;
1953
			$info['message']['lignes'] = $noms_erreur;
2091
		} else {
1954
		} else {
2092
			$info['resultat'] = true;
1955
			$info['resultat'] = true;
2093
		}
1956
		}
2094
		$noms_erreur = null;
1957
		$noms_erreur = null;
2095
		
1958
		
2096
		$this->traiterResultatTest($info);
1959
		$this->traiterResultatTest($info);
2097
	}
1960
	}
2098
	
1961
	
2099
	/**
1962
	/**
2100
	 * Test #64
1963
	 * Test #64
2101
	 */
1964
	 */
2102
	private function testerStatutCultureSyntaxe() {
1965
	private function testerStatutCultureSyntaxe() {
2103
		$info = $this->getInfosTest(64);
1966
		$info = $this->getInfosTest(64);
2104
		
1967
		
2105
		// Réalisation du test
1968
		// Réalisation du test
2106
		$noms_erreur = array();
1969
		$noms_erreur = array();
2107
		foreach ($this->noms as &$nom) {
1970
		foreach ($this->noms as &$nom) {
2108
			if ($nom['statut_culture'] != '') {
1971
			if ($nom['statut_culture'] != '') {
2109
				if (!$this->verifierStatutCulture($nom['statut_culture'])) {
1972
				if (!$this->verifierStatutCulture($nom['statut_culture'])) {
2110
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_culture']);
1973
					$noms_erreur[] = array($nom['num_nom'], $nom['statut_culture']);
2111
				}
1974
				}
2112
			}
1975
			}
2113
		}
1976
		}
2114
		
1977
		
2115
		// Analyse des résultats
1978
		// Analyse des résultats
2116
		if (count($noms_erreur) > 0) {
1979
		if (count($noms_erreur) > 0) {
2117
			$info['message']['entete'] = array('num_nom', 'statut_culture erroné');
1980
			$info['message']['entete'] = array('num_nom', 'statut_culture erroné');
2118
			$info['message']['lignes'] = $noms_erreur;
1981
			$info['message']['lignes'] = $noms_erreur;
2119
		} else {
1982
		} else {
2120
			$info['resultat'] = true;
1983
			$info['resultat'] = true;
2121
		}
1984
		}
2122
		$noms_erreur = null;
1985
		$noms_erreur = null;
2123
		
1986
		
2124
		$this->traiterResultatTest($info);
1987
		$this->traiterResultatTest($info);
2125
	}
1988
	}
2126
	
1989
	
2127
	/**
1990
	/**
2128
	 * Test #65
1991
	 * Test #65
2129
	 */
1992
	 */
2130
	private function testerExclureTaxRefSyntaxe() {
1993
	private function testerExclureTaxRefSyntaxe() {
2131
		$info = $this->getInfosTest(65);
1994
		$info = $this->getInfosTest(65);
2132
	
1995
	
2133
		// Réalisation du testCe n'est pas programmé.
1996
		// Réalisation du testCe n'est pas programmé.
2134
		$noms_erreur = array();
1997
		$noms_erreur = array();
2135
		foreach ($this->noms as &$nom) {
1998
		foreach ($this->noms as &$nom) {
2136
			if ($nom['exclure_taxref'] != '' && $nom['exclure_taxref'] != null) {
1999
			if ($nom['exclure_taxref'] != '' && $nom['exclure_taxref'] != null) {
2137
				if (!$this->verifierBooleen($nom['exclure_taxref'])) {
2000
				if (!$this->verifierBooleen($nom['exclure_taxref'])) {
2138
					$noms_erreur[] = array($nom['num_nom'], $nom['exclure_taxref']);
2001
					$noms_erreur[] = array($nom['num_nom'], $nom['exclure_taxref']);
2139
				}
2002
				}
2140
			}
2003
			}
2141
		}
2004
		}
2142
		
2005
		
2143
		// Analyse des résultats
2006
		// Analyse des résultats
2144
		if (count($noms_erreur) > 0) {
2007
		if (count($noms_erreur) > 0) {
2145
			$info['message']['entete'] = array('num_nom', 'exclure_taxref erroné');
2008
			$info['message']['entete'] = array('num_nom', 'exclure_taxref erroné');
2146
			$info['message']['lignes'] = $noms_erreur;
2009
			$info['message']['lignes'] = $noms_erreur;
2147
		} else {
2010
		} else {
2148
			$info['resultat'] = true;
2011
			$info['resultat'] = true;
2149
		}
2012
		}
2150
		$noms_erreur = null;
2013
		$noms_erreur = null;
2151
		
2014
		
2152
		$this->traiterResultatTest($info);
2015
		$this->traiterResultatTest($info);
2153
	}
2016
	}
2154
 
2017
 
2155
	
2018
	
2156
 
2019
 
2157
	//+--------------------------------------------------------------------------------------------------------------+//
2020
	//+--------------------------------------------------------------------------------------------------------------+//
2158
	// MÉTHODES COMMUNES aux TESTS
2021
	// MÉTHODES COMMUNES aux TESTS
2159
	
2022
	
2160
	private function verifierPresence(&$valeur) {
2023
	private function verifierPresence(&$valeur) {
2161
		$codes = $this->manuel['codes_presence'];
2024
		$codes = $this->manuel['codes_presence'];
2162
		$ok = $this->verifierStatuts($valeur, $codes);
2025
		$ok = $this->verifierStatuts($valeur, $codes);
2163
		return $ok;
2026
		return $ok;
2164
	}
2027
	}
2165
	
2028
	
2166
	private function verifierStatutOrigine(&$valeur) {
2029
	private function verifierStatutOrigine(&$valeur) {
2167
		$codes = $this->manuel['codes_statuts_origine'];
2030
		$codes = $this->manuel['codes_statuts_origine'];
2168
		$ok = $this->verifierStatuts($valeur, $codes);
2031
		$ok = $this->verifierStatuts($valeur, $codes);
2169
		return $ok;
2032
		return $ok;
2170
	}
2033
	}
2171
	
2034
	
2172
	private function verifierStatutIntroduction(&$valeur) {
2035
	private function verifierStatutIntroduction(&$valeur) {
2173
		$codes = $this->manuel['codes_statuts_introduction'];
2036
		$codes = $this->manuel['codes_statuts_introduction'];
2174
		$ok = $this->verifierStatuts($valeur, $codes);
2037
		$ok = $this->verifierStatuts($valeur, $codes);
2175
		return $ok;
2038
		return $ok;
2176
	}
2039
	}
2177
	
2040
	
2178
	private function verifierStatutCulture(&$valeur) {
2041
	private function verifierStatutCulture(&$valeur) {
2179
		$codes = $this->manuel['codes_statuts_culture'];
2042
		$codes = $this->manuel['codes_statuts_culture'];
2180
		$ok = $this->verifierStatuts($valeur, $codes);
2043
		$ok = $this->verifierStatuts($valeur, $codes);
2181
		return $ok;
2044
		return $ok;
2182
	}
2045
	}
2183
	
2046
	
2184
	private function verifierStatuts(&$valeur, &$codes) {
2047
	private function verifierStatuts(&$valeur, &$codes) {
2185
		$ok = true;
2048
		$ok = true;
2186
		if (!preg_match("/^(?:|-|[$codes](?:-[A-Z])?)$/", $valeur)) {
2049
		if (!preg_match("/^(?:|-|[$codes](?:-[A-Z])?)$/", $valeur)) {
2187
			$ok = false;
2050
			$ok = false;
2188
		}
2051
		}
2189
		return $ok;
2052
		return $ok;
2190
	}
2053
	}
2191
	
2054
	
2192
	private function verifierBooleen(&$valeur) {
2055
	private function verifierBooleen(&$valeur) {
2193
		$ok = true;
2056
		$ok = true;
2194
		if (!preg_match('/^1$/', $valeur)) {
2057
		if (!preg_match('/^1$/', $valeur)) {
2195
			$ok = false;
2058
			$ok = false;
2196
		}
2059
		}
2197
		return $ok;
2060
		return $ok;
2198
	}
2061
	}
2199
	
2062
	
2200
	private function verifierNombre(&$valeur) {
2063
	private function verifierNombre(&$valeur) {
2201
		$ok = true;
2064
		$ok = true;
2202
		if (!preg_match('/^[0-9]+$/', $valeur)) {
2065
		if (!preg_match('/^[0-9]+$/', $valeur)) {
2203
			$ok = false;
2066
			$ok = false;
2204
		}
2067
		}
2205
		return $ok;
2068
		return $ok;
2206
	}
2069
	}
2207
	
2070
	
2208
	private function verifierNombreSuite(&$valeur) {
2071
	private function verifierNombreSuite(&$valeur) {
2209
		$ok = true;
2072
		$ok = true;
2210
		if (!preg_match('/^(?:[0-9]+,)*[0-9]+$/', $valeur)) {
2073
		if (!preg_match('/^(?:[0-9]+,)*[0-9]+$/', $valeur)) {
2211
			$ok = false;
2074
			$ok = false;
2212
		}
2075
		}
2213
		return $ok;
2076
		return $ok;
2214
	}
2077
	}
2215
	
2078
	
2216
	private function verifierTypeEpithete(&$type) {
2079
	private function verifierTypeEpithete(&$type) {
2217
		$ok = false;
2080
		$ok = false;
2218
		$rejetes = $this->manuel['type_epithete_rejetes'];
2081
		$rejetes = $this->manuel['type_epithete_rejetes'];
2219
		if (preg_replace("/^(?:$rejetes)$/", '', $type) == '') {
2082
		if (preg_replace("/^(?:$rejetes)$/", '', $type) == '') {
2220
			$ok = false;
2083
			$ok = false;
2221
		} else if (preg_match('/^[a-z][-a-z]*[.]?$/', $type)) {
2084
		} else if (preg_match('/^[a-z][-a-z]*[.]?$/', $type)) {
2222
			$ok = true;
2085
			$ok = true;
2223
		}
2086
		}
2224
		return $ok;
2087
		return $ok;
2225
	}
2088
	}
2226
	
2089
	
2227
	private function verifierBiblioOrigine(&$intitule) {
2090
	private function verifierBiblioOrigine(&$intitule) {
2228
		$ok = true;
2091
		$ok = true;
2229
		if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2092
		if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2230
			$ok = false;// Contient des espaces en trop
2093
			$ok = false;// Contient des espaces en trop
2231
		} else if (!preg_match('/^(?:in [^;]+[;]|)[^,]+?(?:[,][^:]+|)(?:[:].+|)$/', $intitule)) {
2094
		} else if (!preg_match('/^(?:in [^;]+[;]|)[^,]+?(?:[,][^:]+|)(?:[:].+|)$/', $intitule)) {
2232
			$ok = false;
2095
			$ok = false;
2233
		} else if (preg_match('/(?:(?:^|[,:])\s*(?:[:,]|$))/', $intitule)) {
2096
		} else if (preg_match('/(?:(?:^|[,:])\s*(?:[:,]|$))/', $intitule)) {
2234
			$ok = false;// Contient une mauvaise suite de caractères
2097
			$ok = false;// Contient une mauvaise suite de caractères
2235
		}
2098
		}
2236
		return $ok;
2099
		return $ok;
2237
	}
2100
	}
2238
	
2101
	
2239
	private function verifierAnnee(&$annee) {
2102
	private function verifierAnnee(&$annee) {
2240
		$ok = true;
2103
		$ok = true;
2241
		if (!preg_match('/^[0-9]{4}$/', $annee)) {
2104
		if (!preg_match('/^[0-9]{4}$/', $annee)) {
2242
			$ok = false;
2105
			$ok = false;
2243
		} else if ($annee < 1753) {
2106
		} else if ($annee < 1753) {
2244
			$ok = false;
2107
			$ok = false;
2245
		}
2108
		}
2246
		return $ok;
2109
		return $ok;
2247
	}
2110
	}
2248
	
2111
	
2249
	private function verifierAuteur(&$intitule) {
2112
	private function verifierAuteur(&$intitule) {
2250
		$ok = true;
2113
		$ok = true;
2251
		$acceptes = $this->manuel['auteur_acceptes'];
2114
		$acceptes = $this->manuel['auteur_acceptes'];
2252
		if (!preg_match("/^(?:$acceptes)$/", $intitule)) {
2115
		if (!preg_match("/^(?:$acceptes)$/", $intitule)) {
2253
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2116
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $intitule)) {
2254
				$ok = false;// Contient des espaces en trop
2117
				$ok = false;// Contient des espaces en trop
2255
			} else {
2118
			} else {
2256
				$mots_rejetes = $this->manuel['auteur_mots_rejetes'];
2119
				$mots_rejetes = $this->manuel['auteur_mots_rejetes'];
2257
				$mots = explode(' ', $intitule);
2120
				$mots = explode(' ', $intitule);
2258
				foreach ($mots as $position => $mot) {
2121
				foreach ($mots as $position => $mot) {
2259
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2122
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2260
						$ok = false;// Mot rejeté
2123
						$ok = false;// Mot rejeté
2261
					} else if (preg_match("/^(?:(?:\p{L}|[.'\(\)-])+|[&])$/u", $mot)) {
2124
					} else if (preg_match("/^(?:(?:\p{L}|[.'\(\)-])+|[&])$/u", $mot)) {
2262
						continue;// Mot de l'intitulé auteur
2125
						continue;// Mot de l'intitulé auteur
2263
					} else {
2126
					} else {
2264
						$ok = false;
2127
						$ok = false;
2265
					}
2128
					}
2266
				}
2129
				}
2267
			}
2130
			}
2268
		}
2131
		}
2269
		return $ok;
2132
		return $ok;
2270
	}
2133
	}
2271
	
2134
	
2272
	private function verifierNomCommercial(&$epithete) {
2135
	private function verifierNomCommercial(&$epithete) {
2273
		$ok = false;
2136
		$ok = false;
2274
		if (preg_match("/^[[:upper:][:punct:][:digit:][:space:]]+$/", $epithete)) {
2137
		if (preg_match("/^[[:upper:][:punct:][:digit:][:space:]]+$/", $epithete)) {
2275
			$ok = true;
2138
			$ok = true;
2276
		}
2139
		}
2277
		return $ok;
2140
		return $ok;
2278
	}
2141
	}
2279
	
2142
	
2280
	private function verifierEpitheteCultivar(&$epithete) {
2143
	private function verifierEpitheteCultivar(&$epithete) {
2281
		$ok = true;
2144
		$ok = true;
2282
		$acceptes = $this->manuel['cultivar_acceptes'];
2145
		$acceptes = $this->manuel['cultivar_acceptes'];
2283
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2146
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2284
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2147
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2285
				$ok = false;// Contient des espaces en trop
2148
				$ok = false;// Contient des espaces en trop
2286
			} else {
2149
			} else {
2287
				$mots_rejetes = $this->manuel['cultivar_mots_rejetes'];
2150
				$mots_rejetes = $this->manuel['cultivar_mots_rejetes'];
2288
				$mots_mineurs = $this->manuel['mots_mineurs'];
2151
				$mots_mineurs = $this->manuel['mots_mineurs'];
2289
				$mots = explode(' ', $epithete);
2152
				$mots = explode(' ', $epithete);
2290
				foreach ($mots as $position => $mot) {
2153
				foreach ($mots as $position => $mot) {
2291
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2154
					if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2292
						$ok = false;// Mot rejeté
2155
						$ok = false;// Mot rejeté
2293
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2156
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2294
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2157
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2295
					} else {
2158
					} else {
2296
						$mots_tiret = explode('-', $mot);
2159
						$mots_tiret = explode('-', $mot);
2297
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2160
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2298
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2161
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2299
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position
2162
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position
2300
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2163
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2301
								continue;//Mot (ou 'mot-tiret') avec lettre initiale majuscule
2164
								continue;//Mot (ou 'mot-tiret') avec lettre initiale majuscule
2302
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2165
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2303
								continue;//Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2166
								continue;//Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2304
							} else {
2167
							} else {
2305
								$ok = false;
2168
								$ok = false;
2306
							}
2169
							}
2307
						}
2170
						}
2308
					}
2171
					}
2309
				}
2172
				}
2310
			}
2173
			}
2311
		}
2174
		}
2312
		return $ok;
2175
		return $ok;
2313
	}
2176
	}
2314
	
2177
	
2315
	private function verifierEpitheteGroupeCultivar(&$epithete) {
2178
	private function verifierEpitheteGroupeCultivar(&$epithete) {
2316
		$ok = true;
2179
		$ok = true;
2317
		$acceptes = $this->manuel['cultivar_gp_acceptes'];
2180
		$acceptes = $this->manuel['cultivar_gp_acceptes'];
2318
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2181
		if (!preg_match("/^(?:$acceptes)$/", $epithete)) {
2319
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2182
			if (preg_match('/(?:^\s+|\s{2,}|\s+$)/', $epithete)) {
2320
				$ok = false;// Contient des espaces en trop
2183
				$ok = false;// Contient des espaces en trop
2321
			} else {
2184
			} else {
2322
				$mots_acceptes = $this->manuel['cultivar_gp_mots_acceptes'];
2185
				$mots_acceptes = $this->manuel['cultivar_gp_mots_acceptes'];
2323
				$mots_rejetes = $this->manuel['cultivar_gp_mots_rejetes'];
2186
				$mots_rejetes = $this->manuel['cultivar_gp_mots_rejetes'];
2324
				$mots_mineurs = $this->manuel['mots_mineurs'];
2187
				$mots_mineurs = $this->manuel['mots_mineurs'];
2325
				$mots = explode(' ', $epithete);
2188
				$mots = explode(' ', $epithete);
2326
				foreach ($mots as $position => $mot) {
2189
				foreach ($mots as $position => $mot) {
2327
					if (preg_match("/^(?:$mots_acceptes)$/i", $mot)) {
2190
					if (preg_match("/^(?:$mots_acceptes)$/i", $mot)) {
2328
						continue;// Mot accepté
2191
						continue;// Mot accepté
2329
					} else if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2192
					} else if (preg_match("/^(?:$mots_rejetes)$/i", $mot)) {
2330
						$ok = false;// Mot rejeté
2193
						$ok = false;// Mot rejeté
2331
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2194
					} else if ($position > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot)) {
2332
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2195
						continue;// Mot mineur en minuscule qui n'est pas en 1ère position
2333
					} else {
2196
					} else {
2334
						$mots_tiret = explode('-', $mot);
2197
						$mots_tiret = explode('-', $mot);
2335
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2198
						foreach ($mots_tiret as $position_tiret => $mot_tiret) {
2336
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2199
							if ($position_tiret > 0 && preg_match("/^(?:$mots_mineurs)$/", $mot_tiret)) {
2337
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position dans le mot
2200
								continue;// Mot-tiret mineur en minuscule qui n'est pas en 1ère position dans le mot
2338
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2201
							} else if (preg_match('/^[[:upper:]][[:lower:]]+$/', $mot_tiret)) {
2339
								continue;// Mot (ou 'mot-tiret') avec lettre initiale majuscule
2202
								continue;// Mot (ou 'mot-tiret') avec lettre initiale majuscule
2340
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2203
							} else if ($position_tiret == count($mots_tiret) && preg_match('/^[:upper:][:lower:]+[:punct:]?$/', $mot_tiret)) {
2341
								continue;// Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2204
								continue;// Dernier mot (ou 'mot-tiret') avec lettre initiale majuscule, suivi d'un éventuel signe de ponctuation
2342
							} else {
2205
							} else {
2343
								$ok = false;
2206
								$ok = false;
2344
							}
2207
							}
2345
						}
2208
						}
2346
					}
2209
					}
2347
				}
2210
				}
2348
			}
2211
			}
2349
		}
2212
		}
2350
		return $ok;
2213
		return $ok;
2351
	}
2214
	}
2352
	
2215
	
2353
	private function verifierEpitheteSp(&$epithete) {
2216
	private function verifierEpitheteSp(&$epithete) {
2354
		$ok = false;
2217
		$ok = false;
2355
		if (preg_match('/^[a-zëï][-a-zëï]+$/', $epithete)) {
2218
		if (preg_match('/^[a-zëï][-a-zëï]+$/', $epithete)) {
2356
			$ok = true;
2219
			$ok = true;
2357
		} else if (preg_match('/^sp\.(?:[A-Z]|[1-9][0-9]*)$/', $epithete)) {
2220
		} else if (preg_match('/^sp\.(?:[A-Z]|[1-9][0-9]*)$/', $epithete)) {
2358
			$ok = true;
2221
			$ok = true;
2359
		}
2222
		}
2360
		return $ok;
2223
		return $ok;
2361
	}
2224
	}
2362
	
2225
	
2363
	private function verifierEpitheteGenre(&$epithete) {
2226
	private function verifierEpitheteGenre(&$epithete) {
2364
		$ok = false;
2227
		$ok = false;
2365
		if (preg_match('/^[A-ZËÏ](?:[-a-zëï]+|[a-zëï]+-[A-ZËÏ][a-zëï]+)$/', $epithete)) {
2228
		if (preg_match('/^[A-ZËÏ](?:[-a-zëï]+|[a-zëï]+-[A-ZËÏ][a-zëï]+)$/', $epithete)) {
2366
			$ok = true;
2229
			$ok = true;
2367
		}
2230
		}
2368
		return $ok;
2231
		return $ok;
2369
	}
2232
	}
2370
	
2233
	
2371
	private function formaterStyleNomGenre(&$genre) {
2234
	private function formaterStyleNomGenre(&$genre) {
2372
		$genre_fmt = '';
2235
		$genre_fmt = '';
2373
		if (preg_match('/^\s*([x+])\s+(.+)$/i', $genre, $match)) {
2236
		if (preg_match('/^\s*([x+])\s+(.+)$/i', $genre, $match)) {
2374
			$genre_fmt = strtolower($match[1]).' '.ucfirst(strtolower($match[2]));
2237
			$genre_fmt = strtolower($match[1]).' '.ucfirst(strtolower($match[2]));
2375
		} else {
2238
		} else {
2376
			$genre_fmt = ucfirst(strtolower($genre));
2239
			$genre_fmt = ucfirst(strtolower($genre));
2377
		}
2240
		}
2378
		return $genre_fmt;
2241
		return $genre_fmt;
2379
	}
2242
	}
2380
	
2243
	
2381
	private function repererEspace($nom_sci) {
2244
	private function repererEspace($nom_sci) {
2382
		$nom_sci = str_replace(' ', '<span class="espace">&nbsp;</span>', $nom_sci);
2245
		$nom_sci = str_replace(' ', '<span class="espace">&nbsp;</span>', $nom_sci);
2383
		return $nom_sci;
2246
		return $nom_sci;
2384
	}
2247
	}
2385
	
2248
	
2386
	private function construireSuffixeNomPltCultivee(&$nom) {
2249
	private function construireSuffixeNomPltCultivee(&$nom) {
2387
		$suffixe = array();
2250
		$suffixe = array();
2388
		$suffixe[] = $this->construireNomCultivarGroupe($nom);
2251
		$suffixe[] = $this->construireNomCultivarGroupe($nom);
2389
		$suffixe[] = $this->construireNomCommercial($nom);
2252
		$suffixe[] = $this->construireNomCommercial($nom);
2390
		$suffixe[] = $this->construireNomCultivar($nom);
2253
		$suffixe[] = $this->construireNomCultivar($nom);
2391
		$suffixe = array_filter($suffixe);
2254
		$suffixe = array_filter($suffixe);
2392
		return implode(' ', $suffixe);
2255
		return implode(' ', $suffixe);
2393
	}
2256
	}
2394
	
2257
	
2395
	private function construireNomCultivarGroupe(&$nom) {
2258
	private function construireNomCultivarGroupe(&$nom) {
2396
		$nom_groupe_cultivar = '';
2259
		$nom_groupe_cultivar = '';
2397
		if ($nom['cultivar_groupe'] != '') {
2260
		if ($nom['cultivar_groupe'] != '') {
2398
			if (preg_match('/ gx$/', $nom['cultivar_groupe'])) {
2261
			if (preg_match('/ gx$/', $nom['cultivar_groupe'])) {
2399
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].')';
2262
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].')';
2400
			} else {
2263
			} else {
2401
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].' Gp)';
2264
				$nom_groupe_cultivar =  '('.$nom['cultivar_groupe'].' Gp)';
2402
			}
2265
			}
2403
		}
2266
		}
2404
		return $nom_groupe_cultivar;
2267
		return $nom_groupe_cultivar;
2405
	}
2268
	}
2406
	
2269
	
2407
	private function construireNomCommercial(&$nom) {
2270
	private function construireNomCommercial(&$nom) {
2408
		$nom_commercial = '';
2271
		$nom_commercial = '';
2409
		if ($nom['nom_commercial'] != '') {
2272
		if ($nom['nom_commercial'] != '') {
2410
			$nom_commercial =  strtoupper($nom['nom_commercial']);
2273
			$nom_commercial =  strtoupper($nom['nom_commercial']);
2411
		}
2274
		}
2412
		return $nom_commercial;
2275
		return $nom_commercial;
2413
	}
2276
	}
2414
	
2277
	
2415
	private function construireNomCultivar(&$nom) {
2278
	private function construireNomCultivar(&$nom) {
2416
		$nom_cultivar = '';
2279
		$nom_cultivar = '';
2417
		if ($nom['cultivar'] != '') {
2280
		if ($nom['cultivar'] != '') {
2418
			$nom_cultivar =  "'".$nom['cultivar']."'";
2281
			$nom_cultivar =  "'".$nom['cultivar']."'";
2419
		}
2282
		}
2420
		return $nom_cultivar;
2283
		return $nom_cultivar;
2421
	}
2284
	}
2422
	
2285
	
2423
	private function classerNomsParNomComplet() {
2286
	private function classerNomsParNomComplet() {
2424
		$noms_classes = array();
2287
		$noms_classes = array();
2425
		foreach ($this->noms as &$nom) {
2288
		foreach ($this->noms as &$nom) {
2426
			if (!isset($noms_classes[$nom['nom_sci']])) {
2289
			if (!isset($noms_classes[$nom['nom_sci']])) {
2427
				$noms_classes[$nom['nom_sci']] = 1;
2290
				$noms_classes[$nom['nom_sci']] = 1;
2428
			} else {
2291
			} else {
2429
				$noms_classes[$nom['nom_sci']]++;
2292
				$noms_classes[$nom['nom_sci']]++;
2430
			}
2293
			}
2431
		}
2294
		}
2432
		return $noms_classes;
2295
		return $noms_classes;
2433
	}
2296
	}
2434
 
2297
 
2435
	private function getInfosTest($numero) {
2298
	private function getInfosTest($numero) {
2436
		$info = $this->tests[$numero];
2299
		$info = $this->tests[$numero];
2437
		$info['methode'] = 'tester'.implode('', explode(' ', ucwords($info['abr'])));
2300
		$info['methode'] = 'tester'.implode('', explode(' ', ucwords($info['abr'])));
2438
		$info['numero'] = $numero; 
2301
		$info['numero'] = $numero; 
2439
		$info['resultat'] = false;
2302
		$info['resultat'] = false;
2440
		return $info;
2303
		return $info;
2441
	}
2304
	}
2442
}
2305
}
2443
?>
2306
?>