183,7 → 183,7 |
$this->assertEquals('1', $retour['entete']['total'], "L'attribut 'total' de l'entête devrait valoir 1. Voir : $url"); |
|
$this->assertArrayHasKey('resultat', $retour, "Le json ne contient pas d'attribut : resultat. Voir : $url"); |
$this->assertEquals('Acer monspessulanum L. [1753, Sp. Pl., éd. 1 : 1056]', $retour['resultat']['182']['nom_sci_complet'], "Le tableau du résultat 182 doit contenir un champ 'nom_sci' avec pour valeur 'Acer monspessulanum'. Voir : $url"); |
$this->assertEquals('Acer monspessulanum L. [1753, Sp. Pl., éd. 1 : 1056]', $retour['resultat']['182']['nom_sci'], "Le tableau du résultat 182 doit contenir un champ 'nom_sci' avec pour valeur 'Acer monspessulanum'. Voir : $url"); |
} |
|
public function testNsStructureHtml() { |
206,7 → 206,7 |
$this->assertArrayHasKey('resultat', $retour, "Le json ne contient pas d'attribut : resultat.\nVoir : $url"); |
$attendu = '<span class="sci"><span class="gen">Acer</span> <span class="sp">monspessulanum</span></span> <span class="auteur">L.</span> [<span class="annee">1753</span>, <span class="biblio">Sp. Pl., éd. 1 : 1056</span>]'; |
$message = "Le tableau du résultat 182 doit contenir un champ 'nom_sci' avec pour valeur '$attendu'. Voir : $url"; |
$this->assertEquals($attendu, $retour['resultat']['182']['nom_sci_complet'], $message); |
$this->assertEquals($attendu, $retour['resultat']['182']['nom_sci'], $message); |
} |
|
public function testListeNomsAvecParametreRetourChamps() { |
245,7 → 245,7 |
$this->assertArrayHasKey('39607', $retour['resultat']); |
$this->assertArrayHasKey('nom_sci', $retour['resultat']['39607']); |
$nomSciTxt = 'Lolium annuum Gilib. [1792, Exercit. Phytol., 2 : 520] [nom. invalid.]'; |
$this->assertEquals($nomSciTxt, $retour['resultat']['39607']['nom_sci_complet']); |
$this->assertEquals($nomSciTxt, $retour['resultat']['39607']['nom_sci']); |
} |
|
public function testListeNomAvecParametreNsStructureAuAnBibAdEtNsFormatHtm() { |
264,26 → 264,7 |
$this->assertArrayHasKey('39607', $retour['resultat']); |
$this->assertArrayHasKey('nom_sci', $retour['resultat']['39607']); |
$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>]"; |
$this->assertEquals($nomSciHtml, $retour['resultat']['39607']['nom_sci_complet']); |
$this->assertEquals($nomSciHtml, $retour['resultat']['39607']['nom_sci']); |
} |
|
public function testListeNomAvecParametreRetourChamps() { |
$ressources = array(); |
$parametres = array('version.projet' => '1.01', |
'masque.nn' => '39607', |
'retour.champs' => 'rang,auteur'); |
|
$retour = $this->consulterJson($ressources, $parametres); |
$this->assertArrayHasKey('entete', $retour); |
$this->assertArrayHasKey('masque', $retour['entete']); |
$this->assertEquals('num_nom=39607', $retour['entete']['masque']); |
|
$this->assertArrayHasKey('resultat', $retour); |
$this->assertArrayHasKey('39607', $retour['resultat']); |
$this->assertArrayHasKey('rang.libelle', $retour['resultat']['39607']); |
$this->assertEquals('Espèce', $retour['resultat']['39607']['rang.libelle']); |
$this->assertArrayHasKey('auteur', $retour['resultat']['39607']); |
$this->assertEquals('Gilib.', $retour['resultat']['39607']['auteur']); |
} |
} |
?> |