Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 862 Rev 863
Line 175... Line 175...
175
		$url = ServiceEflorePhpUnit::creerUrl(self::$S, array("bdtfx.nn:182"), array("masque.famille" => "S_pindaceae"));
175
		$url = ServiceEflorePhpUnit::creerUrl(self::$S, array("bdtfx.nn:182"), array("masque.famille" => "S_pindaceae"));
176
		$retour = $this->consulterJson(self::$S, self::$P, array("bdtfx.nn:182"), array("masque.famille" => "S_pindaceae"));
176
		$retour = $this->consulterJson(self::$S, self::$P, array("bdtfx.nn:182"), array("masque.famille" => "S_pindaceae"));
177
		$this->assertEquals(1, $retour['entete']['total'], "L'attribut 'total' devrait avoir la valeur 1. Voir : $url");
177
		$this->assertEquals(1, $retour['entete']['total'], "L'attribut 'total' devrait avoir la valeur 1. Voir : $url");
178
	}
178
	}
Line -... Line 179...
-
 
179
 
-
 
180
	// le webservice permet de définir la clef d'index choisir: par num_nom de coste ou num_nom de bdtfx
-
 
181
	public function testIndex() {
-
 
182
		$url = ServiceEflorePhpUnit::creerUrl(self::$S, NULL, array("masque.famille" => "Sapindaceae"));
-
 
183
		$retour = $this->consulterJson(self::$S, self::$P, NULL, array("masque.famille" => "Sapindaceae"));
-
 
184
		$e = array(1030,1027,1026,1028,1036,1025);
-
 
185
		$r = array_keys($retour['resultats']);
-
 
186
		sort($r);sort($e);
-
 
187
		$this->assertEquals($e, $r, "Erreur des l'index des résultats. Voir : $url");
-
 
188
 
-
 
189
		$url = ServiceEflorePhpUnit::creerUrl(self::$S, NULL, array("masque.famille" => "Sapindaceae", "retour.indexBy" => "bdtfx"));
-
 
190
		$retour = $this->consulterJson(self::$S, self::$P, NULL, array("masque.famille" => "Sapindaceae", "retour.indexBy" => "bdtfx"));
-
 
191
		$e = array(182,1053,74934,210,141,199);
-
 
192
		$r = array_keys($retour['resultats']);
-
 
193
		sort($r);sort($e);
-
 
194
		$this->assertEquals($e, $r, "Erreur des l'index des résultats. Voir : $url");
-
 
195
 
-
 
196
		// le taxon coste:nn:183 ne correspond à ce jour (2013/09/04) à aucun taxon bdtfx
-
 
197
		// l'indexation par bdtfx doit donc absolument échouer
-
 
198
		$url = ServiceEflorePhpUnit::creerUrl(self::$S, array(183), array("retour.indexBy" => "bdtfx"));
-
 
199
		$retour = $this->consulterBrut(self::$S, self::$P, array(183), array("retour.indexBy" => "bdtfx"));
-
 
200
		$this->assertContains("error", $retour, "L'indexation par bdtfx doit retourner une erreur en cas de bdtfx.num_nom NULL. Voir : $url");
-
 
201
	}
Line 179... Line 202...
179
 
202
 
180
 
203
 
181
	// commons
204
	// commons
182
	public function commonTestHeader($retour, $url) {
205
	public function commonTestHeader($retour, $url) {