Subversion Repositories Applications.referentiel

Rev

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

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