Subversion Repositories Applications.referentiel

Rev

Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 15
Line 122... Line 122...
122
		$donnees['tests'][] = $this->testerBasionymeSyntaxe($noms);
122
		$donnees['tests'][] = $this->testerBasionymeSyntaxe($noms);
123
		$donnees['tests'][] = $this->testerBasionymeExistence($noms);
123
		$donnees['tests'][] = $this->testerBasionymeExistence($noms);
Line 124... Line 124...
124
		
124
		
125
		$donnees['tests'][] = $this->testerSynonymeProparteSyntaxe($noms);
125
		$donnees['tests'][] = $this->testerSynonymeProparteSyntaxe($noms);
126
		$donnees['tests'][] = $this->testerSynonymeProparteExistence($noms);
-
 
Line 127... Line 126...
127
		*/
126
		$donnees['tests'][] = $this->testerSynonymeProparteExistence($noms);
-
 
127
		
128
		
128
		$donnees['tests'][] = $this->testerSynonymeDouteuxSyntaxe($noms);
Line -... Line 129...
-
 
129
		
-
 
130
		$donnees['tests'][] = $this->testerSynonymeMalAppliqueSyntaxe($noms);
-
 
131
		
-
 
132
		$donnees['tests'][] = $this->testerSynonymeOrthographiqueSyntaxe($noms);
-
 
133
		$donnees['tests'][] = $this->testerSynonymeOrthographiqueExistence($noms);
-
 
134
		
-
 
135
		$donnees['tests'][] = $this->testerHybrideParent01Syntaxe($noms);
-
 
136
		$donnees['tests'][] = $this->testerHybrideParent01Existence($noms);
-
 
137
		$donnees['tests'][] = $this->testerHybrideParent02Syntaxe($noms);
-
 
138
		$donnees['tests'][] = $this->testerHybrideParent02Existence($noms);
-
 
139
		
129
		$donnees['tests'][] = $this->testerSynonymeDouteuxSyntaxe($noms);
140
		*/
130
		$donnees['tests'][] = $this->testerSynonymeMalAppliqueSyntaxe($noms);
141
		
131
		
142
		
Line 132... Line 143...
132
		//Debug::printr($this->manuel);
143
		//Debug::printr($this->manuel);
133
		$this->setSortie(self::RENDU_CORPS, $this->getVue('test', $donnees)); 
144
		$this->setSortie(self::RENDU_CORPS, $this->getVue('test', $donnees)); 
-
 
145
	}
-
 
146
	
-
 
147
	//+--------------------------------------------------------------------------------------------------------------+//
-
 
148
	// TESTS
-
 
149
	private function testerHybrideParent02Existence($noms) {
-
 
150
		$info = array('titre' => 'hybride_parent_02 -> existence',
-
 
151
			'description' => "Si le champ hybride_parent_02 contient un nombre alors il doit correspondre à une valeur du champ ".
-
 
152
			"num_nom.",
-
 
153
			'resultat' => false);
-
 
154
		
-
 
155
		// Réalisation du test
-
 
156
		$noms_erreur = array();
-
 
157
		foreach ($noms as $nom) {
-
 
158
			if ($nom['hybride_parent_02'] != '') {
-
 
159
				if (!isset($noms[$nom['hybride_parent_02']]) && $nom['hybride_parent_02'] != '0') {
-
 
160
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_02']);
-
 
161
				}
-
 
162
			}
-
 
163
		}
-
 
164
		
-
 
165
		// Analyse des résultats
-
 
166
		if (count($noms_erreur) > 0) {
-
 
167
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 introuvable');
-
 
168
			$info['message']['lignes'] = $noms_erreur;
-
 
169
		} else {
-
 
170
			$info['resultat'] = true;
-
 
171
		}
-
 
172
		
-
 
173
		return $info;
-
 
174
	}
-
 
175
	
-
 
176
	private function testerHybrideParent02Syntaxe($noms) {
-
 
177
		$info = array('titre' => 'hybride_parent_02 -> syntaxe',
-
 
178
			'description' => "Le champ hybride_parent_02 contient soit :\n".
-
 
179
			" - une valeur vide.\n".
-
 
180
			" - un nombre",
-
 
181
			'resultat' => false);
-
 
182
		
-
 
183
		// Réalisation du test
-
 
184
		$noms_erreur = array();
-
 
185
		foreach ($noms as $nom) {
-
 
186
			if ($nom['hybride_parent_02'] != '') {
-
 
187
				if (!$this->verifierNombre($nom['hybride_parent_02'])) {
-
 
188
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_02']);
-
 
189
				}
-
 
190
			}
-
 
191
		}
-
 
192
		
-
 
193
		// Analyse des résultats
-
 
194
		if (count($noms_erreur) > 0) {
-
 
195
			$info['message']['entete'] = array('num_nom', 'hybride_parent_02 erroné');
-
 
196
			$info['message']['lignes'] = $noms_erreur;
-
 
197
		} else {
-
 
198
			$info['resultat'] = true;
-
 
199
		}
-
 
200
		
-
 
201
		return $info;
-
 
202
	}
-
 
203
	
-
 
204
	
-
 
205
	private function testerHybrideParent01Existence($noms) {
-
 
206
		$info = array('titre' => 'hybride_parent_01 -> existence',
-
 
207
			'description' => "Si le champ hybride_parent_01 contient un nombre alors il doit correspondre à une valeur du champ ".
-
 
208
			"num_nom.",
-
 
209
			'resultat' => false);
-
 
210
		
-
 
211
		// Réalisation du test
-
 
212
		$noms_erreur = array();
-
 
213
		foreach ($noms as $nom) {
-
 
214
			if ($nom['hybride_parent_01'] != '' && $nom['hybride_parent_01'] != '0') {
-
 
215
				if (!isset($noms[$nom['hybride_parent_01']])) {
-
 
216
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_01']);
-
 
217
				}
-
 
218
			}
-
 
219
		}
-
 
220
		
-
 
221
		// Analyse des résultats
-
 
222
		if (count($noms_erreur) > 0) {
-
 
223
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 introuvable');
-
 
224
			$info['message']['lignes'] = $noms_erreur;
-
 
225
		} else {
-
 
226
			$info['resultat'] = true;
-
 
227
		}
-
 
228
		
-
 
229
		return $info;
-
 
230
	}
-
 
231
	
-
 
232
	private function testerHybrideParent01Syntaxe($noms) {
-
 
233
		$info = array('titre' => 'hybride_parent_01 -> syntaxe',
-
 
234
			'description' => "Le champ hybride_parent_01 contient soit :\n".
-
 
235
			" - une valeur vide.\n".
-
 
236
			" - un nombre",
-
 
237
			'resultat' => false);
-
 
238
		
-
 
239
		// Réalisation du test
-
 
240
		$noms_erreur = array();
-
 
241
		foreach ($noms as $nom) {
-
 
242
			if ($nom['hybride_parent_01'] != '') {
-
 
243
				if (!$this->verifierNombre($nom['hybride_parent_01'])) {
-
 
244
					$noms_erreur[] = array($nom['num_nom'], $nom['hybride_parent_01']);
-
 
245
				}
-
 
246
			}
-
 
247
		}
-
 
248
		
-
 
249
		// Analyse des résultats
-
 
250
		if (count($noms_erreur) > 0) {
-
 
251
			$info['message']['entete'] = array('num_nom', 'hybride_parent_01 erroné');
-
 
252
			$info['message']['lignes'] = $noms_erreur;
-
 
253
		} else {
-
 
254
			$info['resultat'] = true;
-
 
255
		}
-
 
256
		
-
 
257
		return $info;
-
 
258
	}
-
 
259
	
-
 
260
	private function testerSynonymeOrthographiqueExistence($noms) {
-
 
261
		$info = array('titre' => 'synonyme_orthographique -> existence',
-
 
262
			'description' => "Si le champ synonyme_orthographique contient un nombre alors il doit correspondre à une valeur du champ ".
-
 
263
			"num_nom.",
-
 
264
			'resultat' => false);
-
 
265
		
-
 
266
		// Réalisation du test
-
 
267
		$noms_erreur = array();
-
 
268
		foreach ($noms as $nom) {
-
 
269
			if ($nom['synonyme_orthographique'] != '') {
-
 
270
				if (!isset($noms[$nom['synonyme_orthographique']])) {
-
 
271
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
-
 
272
				}
-
 
273
			}
-
 
274
		}
-
 
275
		
-
 
276
		// Analyse des résultats
-
 
277
		if (count($noms_erreur) > 0) {
-
 
278
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique introuvable');
-
 
279
			$info['message']['lignes'] = $noms_erreur;
-
 
280
		} else {
-
 
281
			$info['resultat'] = true;
-
 
282
		}
-
 
283
		
-
 
284
		return $info;
-
 
285
	}
-
 
286
	
-
 
287
	private function testerSynonymeOrthographiqueSyntaxe($noms) {
-
 
288
		$info = array('titre' => 'synonyme_orthographique -> syntaxe',
-
 
289
			'description' => "Le champ synonyme_orthographique contient soit :\n".
-
 
290
			" - une valeur vide.\n".
-
 
291
			" - un nombre",
-
 
292
			'resultat' => false);
-
 
293
		
-
 
294
		// Réalisation du test
-
 
295
		$noms_erreur = array();
-
 
296
		foreach ($noms as $nom) {
-
 
297
			if ($nom['synonyme_orthographique'] != '') {
-
 
298
				if (!$this->verifierNombre($nom['synonyme_orthographique'])) {
-
 
299
					$noms_erreur[] = array($nom['num_nom'], $nom['synonyme_orthographique']);
-
 
300
				}
-
 
301
			}
-
 
302
		}
-
 
303
		
-
 
304
		// Analyse des résultats
-
 
305
		if (count($noms_erreur) > 0) {
-
 
306
			$info['message']['entete'] = array('num_nom', 'synonyme_orthographique erroné');
-
 
307
			$info['message']['lignes'] = $noms_erreur;
-
 
308
		} else {
-
 
309
			$info['resultat'] = true;
Line 134... Line 310...
134
	}
310
		}
135
	
311
		
136
	//+--------------------------------------------------------------------------------------------------------------+//
312
		return $info;
137
	// TESTS
313
	}