177,7 → 177,30 |
$this->assertEquals(1, $retour['entete']['total'], "L'attribut 'total' devrait avoir la valeur 1. Voir : $url"); |
} |
|
// le webservice permet de définir la clef d'index choisir: par num_nom de coste ou num_nom de bdtfx |
public function testIndex() { |
$url = ServiceEflorePhpUnit::creerUrl(self::$S, NULL, array("masque.famille" => "Sapindaceae")); |
$retour = $this->consulterJson(self::$S, self::$P, NULL, array("masque.famille" => "Sapindaceae")); |
$e = array(1030,1027,1026,1028,1036,1025); |
$r = array_keys($retour['resultats']); |
sort($r);sort($e); |
$this->assertEquals($e, $r, "Erreur des l'index des résultats. Voir : $url"); |
|
$url = ServiceEflorePhpUnit::creerUrl(self::$S, NULL, array("masque.famille" => "Sapindaceae", "retour.indexBy" => "bdtfx")); |
$retour = $this->consulterJson(self::$S, self::$P, NULL, array("masque.famille" => "Sapindaceae", "retour.indexBy" => "bdtfx")); |
$e = array(182,1053,74934,210,141,199); |
$r = array_keys($retour['resultats']); |
sort($r);sort($e); |
$this->assertEquals($e, $r, "Erreur des l'index des résultats. Voir : $url"); |
|
// le taxon coste:nn:183 ne correspond à ce jour (2013/09/04) à aucun taxon bdtfx |
// l'indexation par bdtfx doit donc absolument échouer |
$url = ServiceEflorePhpUnit::creerUrl(self::$S, array(183), array("retour.indexBy" => "bdtfx")); |
$retour = $this->consulterBrut(self::$S, self::$P, array(183), array("retour.indexBy" => "bdtfx")); |
$this->assertContains("error", $retour, "L'indexation par bdtfx doit retourner une erreur en cas de bdtfx.num_nom NULL. Voir : $url"); |
} |
|
|
// commons |
public function commonTestHeader($retour, $url) { |
$this->assertNotEmpty($retour, 'données absentes'); |