Subversion Repositories Applications.referentiel

Rev

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

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