Line 230... |
Line 230... |
230 |
$this->presenceAttributDansResultat(83587, 'nom_retenu.id');
|
230 |
$this->presenceAttributDansResultat(83587, 'nom_retenu.id');
|
231 |
$this->presenceAttributDansResultat(83587, 'nom_retenu.href');
|
231 |
$this->presenceAttributDansResultat(83587, 'nom_retenu.href');
|
232 |
$this->abscenceAttributDansResultat(83587, 'nom_retenu');
|
232 |
$this->abscenceAttributDansResultat(83587, 'nom_retenu');
|
233 |
}*/
|
233 |
}*/
|
Line -... |
Line 234... |
- |
|
234 |
|
- |
|
235 |
// TODO : à implémenter
|
- |
|
236 |
/*
|
- |
|
237 |
public function testNomsIdAvecParametreRetourChamps() {
|
- |
|
238 |
$ressources = array('1');
|
- |
|
239 |
$parametres = array('version.projet' => '1.01',
|
- |
|
240 |
'retour.champs' => 'nom_retenu.*');
|
- |
|
241 |
|
- |
|
242 |
$this->retour = $this->consulter($ressources, $parametres);
|
- |
|
243 |
|
- |
|
244 |
$this->presenceAttribut('nom_retenu.id');
|
- |
|
245 |
$this->presenceAttribut('nom_retenu.href');
|
- |
|
246 |
$this->abscenceAttribut('nom_retenu');
|
- |
|
247 |
$this->abscenceAttribut('auteur');
|
- |
|
248 |
}*/
|
- |
|
249 |
|
- |
|
250 |
// TODO : à implémenter
|
- |
|
251 |
/*
|
- |
|
252 |
public function testListeNomAvecParametreNsStructureAuAnBibAd() {
|
- |
|
253 |
$ressources = array();
|
- |
|
254 |
$parametres = array('version.projet' => '1.01',
|
- |
|
255 |
'masque.nn' => '39607',
|
- |
|
256 |
'ns.structure' => 'au,an,bib,ad');
|
- |
|
257 |
|
- |
|
258 |
$this->retour = $this->consulter($ressources, $parametres);
|
- |
|
259 |
|
- |
|
260 |
$this->verifierStructureListe();
|
- |
|
261 |
$this->presenceAttributDansResultat(39607, 'nom_sci');
|
- |
|
262 |
|
- |
|
263 |
$nomSciTxt = 'Lolium annuum Gilib. [1792, Exercit. Phytol., 2 : 520] [nom. invalid.]';
|
- |
|
264 |
$this->verifierResultatsLigneAttributValeur(39607, 'nom_sci', $nomSciTxt);
|
- |
|
265 |
}*/
|
- |
|
266 |
|
- |
|
267 |
// TODO : à implémenter
|
- |
|
268 |
/*
|
- |
|
269 |
public function testListeNomAvecParametreNsStructureAuAnBibAdEtNsFormatHtm() {
|
- |
|
270 |
$ressources = array();
|
- |
|
271 |
$parametres = array('version.projet' => '1.01',
|
- |
|
272 |
'masque.nn' => '39607',
|
- |
|
273 |
'ns.structure' => 'au,an,bib,ad',
|
- |
|
274 |
'ns.format' => 'htm');
|
- |
|
275 |
|
- |
|
276 |
$this->retour = $this->consulter($ressources, $parametres);
|
- |
|
277 |
|
- |
|
278 |
$this->verifierStructureListe();
|
- |
|
279 |
$this->verifierMasque('num_nom=39607');
|
- |
|
280 |
|
- |
|
281 |
$this->presenceAttributDansResultat(39607, 'nom_sci');
|
- |
|
282 |
|
- |
|
283 |
$nomSciHtml = "<span class=\"sci\"><span class=\"gen\">Lolium</span> <span class=\"sp\">annuum</span></span> <span class=\"auteur\">Gilib.</span> [<span class=\"annee\">1792</span>, <span class=\"biblio\">Exercit. Phytol., 2 : 520</span>] [<span class=\"adendum\">nom. invalid.</span>]";
|
- |
|
284 |
$this->verifierResultatsLigneAttributValeur(39607, 'nom_sci', $nomSciHtml);
|
- |
|
285 |
}*/
|
234 |
|
286 |
|
235 |
public function testSansParametres() {
|
287 |
public function testSansParametres() {
|
236 |
$ressources = array('85');
|
288 |
$ressources = array('85');
|
Line 237... |
Line 289... |
237 |
$parametres = array();
|
289 |
$parametres = array();
|
Line 277... |
Line 329... |
277 |
|
329 |
|
278 |
public function testNomSansCorrespondance() {
|
330 |
public function testNomSansCorrespondance() {
|
279 |
$ressources = array('98940');
|
331 |
$ressources = array('98940');
|
Line 280... |
Line 332... |
280 |
$parametres = array();
|
332 |
$parametres = array();
|
Line 281... |
Line 333... |
281 |
|
333 |
|
282 |
$retour = $this->consulter($ressources, $parametres);
|
334 |
$this->retour = $this->consulter($ressources, $parametres);
|
283 |
|
335 |
|
284 |
$this->assertArrayNotHasKey('nom_retenu.id', $retour, 'Abscence champ nom_retenu.id');
|
- |
|
285 |
$this->assertArrayHasKey('nom_retenu', $retour, 'Présence champ nom_retenu');
|
336 |
$this->abscenceAttribut('nom_retenu.id');
|
Line 286... |
Line 337... |
286 |
$this->assertSame(null, $retour['nom_retenu'], 'Valeur champ nom_retenu = null');
|
337 |
$this->abscenceAttribut('nom_retenu.href');
|
287 |
$this->assertArrayNotHasKey('nom_retenu.href', $retour, 'Abscence champ nom_retenu.href');
|
338 |
$this->verifierAttributValeur('nom_retenu', null);
|
288 |
}
|
339 |
}
|
Line 318... |
Line 369... |
318 |
$this->assertArrayHasKey('retenu', $this->retour['resultats'][$ligne], "Presence attribut : resultats>$ligne>retenu".print_r($this->retour, true));
|
369 |
$this->assertArrayHasKey('retenu', $this->retour['resultats'][$ligne], "Presence attribut : resultats>$ligne>retenu".print_r($this->retour, true));
|
319 |
$this->assertArrayHasKey('href', $this->retour['resultats'][$ligne], "Presence attribut : resultats>$ligne>href".print_r($this->retour, true));
|
370 |
$this->assertArrayHasKey('href', $this->retour['resultats'][$ligne], "Presence attribut : resultats>$ligne>href".print_r($this->retour, true));
|
320 |
}
|
371 |
}
|
Line 321... |
Line 372... |
321 |
|
372 |
|
- |
|
373 |
private function presenceAttributDansResultat($ligne, $attribut) {
|
322 |
private function presenceAttributDansResultat($ligne, $attribut) {
|
374 |
$this->assertArrayHasKey($ligne, $this->retour['resultats'], "Présence ligne : resultats>$ligne");
|
323 |
$this->assertArrayHasKey($attribut, $this->retour['resultats'][$ligne], "Présence attribut : resultats>$ligne>$attribut");
|
375 |
$this->assertArrayHasKey($attribut, $this->retour['resultats'][$ligne], "Présence attribut : resultats>$ligne>$attribut");
|
Line 324... |
Line 376... |
324 |
}
|
376 |
}
|
325 |
|
377 |
|
326 |
private function abscenceAttributDansResultat($ligne, $attribut) {
|
378 |
private function abscenceAttributDansResultat($ligne, $attribut) {
|
Line 327... |
Line 379... |
327 |
$this->assertArrayNotHasKey($attribut, $this->retour['resultats'][$ligne], "Présence attribut : resultats>$ligne>$attribut");
|
379 |
$this->assertArrayNotHasKey($attribut, $this->retour['resultats'][$ligne], "Présence attribut : resultats>$ligne>$attribut");
|
328 |
}
|
380 |
}
|
329 |
|
381 |
|
- |
|
382 |
private function verifierResultatsLigneAttributValeur($ligne, $attribut, $valeur) {
|
- |
|
383 |
$this->assertSame($valeur, $this->retour['resultats'][$ligne][$attribut], "Attribut 'resultats>$ligne>$attribut' = $valeur");
|
- |
|
384 |
}
|
- |
|
385 |
|
- |
|
386 |
private function presenceAttribut($attribut) {
|
- |
|
387 |
$this->assertArrayHasKey($attribut, $this->retour);
|
- |
|
388 |
}
|
- |
|
389 |
|
- |
|
390 |
private function abscenceAttribut($attribut) {
|
- |
|
391 |
$this->assertArrayNotHasKey($attribut, $this->retour);
|
- |
|
392 |
}
|
- |
|
393 |
|
- |
|
394 |
private function verifierAttributValeur($attribut, $valeur) {
|
330 |
private function verifierResultatsLigneAttributValeur($ligne, $attribut, $valeur) {
|
395 |
$this->presenceAttribut($attribut);
|
331 |
$this->assertSame($valeur, $this->retour['resultats'][$ligne][$attribut], "Attribut 'resultats>$ligne>$attribut' = $valeur");
|
396 |
$this->assertSame($valeur, $this->retour[$attribut]);
|
332 |
}
|
397 |
}
|