Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1378 Rev 1382
Line 23... Line 23...
23
		$this->hasKeysAndNotEmpty($retour, ['auteur.id', 'auteur.nom', 'date_transmission', 'observateur', 'id_observation'], $url);
23
		$this->hasKeysAndNotEmpty($retour, ['auteur.id', 'auteur.nom', 'date_transmission', 'observateur', 'id_observation'], $url);
24
		$this->hasKeys($retour, ['auteur.nom'], $url);
24
		$this->hasKeys($retour, ['auteur.nom'], $url);
25
		$this->assertArrayHasKey('auteur.id', $retour, "attribut auteur.id manquant. Voir : $url");
25
		$this->assertArrayHasKey('auteur.id', $retour, "attribut auteur.id manquant. Voir : $url");
26
	}
26
	}
Line -... Line 27...
-
 
27
 
-
 
28
 
-
 
29
	public function testExistantEtContenu() {
-
 
30
		$url = $this->creerUrl('observations');
-
 
31
		$i = new Observations();
-
 
32
		$retour = $this->consulterDirectJson($i->consulter([1043942], []),
-
 
33
											$url);
-
 
34
 
-
 
35
		// from
-
 
36
		// "http://www.tela-botanica.org/eflore/del/services/0.1/observations/1048532
-
 
37
		$expected = json_decode(file_get_contents("obs-1048532-complete.data.json"), true);
-
 
38
 
-
 
39
		self::ignoreNullValuesAndSort($expected);
-
 
40
		self::ignoreNullValuesAndSort($retour);
-
 
41
 
-
 
42
		// echo implode(',', array_keys($retour['resultats'])) . "\n" . implode(',', array_keys($expected['resultats']));die;
-
 
43
		$this->clefsIdentiques($expected, $retour, $url);
-
 
44
		$this->assertEquals($expected['resultats'], $retour['resultats'], "Différences dans le tableau pour l'obs 1048532, $url");
-
 
45
	}
27
 
46
 
28
	public function testSansImage() {
47
	public function testSansImage() {
29
		$url = $this->creerUrl('observations');
48
		$url = $this->creerUrl('observations');
30
		$i = new Observations();
49
		$i = new Observations();
31
		$retour = $this->consulterDirectJson($i->consulter([14203], []),
50
		$retour = $this->consulterDirectJson($i->consulter([14203], []),