Subversion Repositories eFlore/Applications.del

Rev

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

Rev 727 Rev 1360
Line 1... Line 1...
1
<?php
1
<?php
-
 
2
/*
-
 
3
 * @author		Grégoire DUCHE <gregoire@tela-botanica.org>
-
 
4
 * @author		Raphaël Droz <raphael@tela-botanica.org>
-
 
5
 * @copyright	Copyright (c) 2012, 2013 Tela Botanica (accueil@tela-botanica.org)
-
 
6
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
-
 
7
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
-
 
8
 *
-
 
9
 * Classe de test pour /del/services/0.1/images
-
 
10
 */
2
require_once dirname(__FILE__).'/../ServiceDelPhpUnit.php';
11
require_once dirname(__FILE__).'/../ServiceDelPhpUnit.php';
Line 3... Line 12...
3
 
12
 
Line 4... Line 13...
4
class BdtfxNomsTest extends ServiceDelPhpUnit {
13
class ImagesTest extends ServiceDelPhpUnit {
Line 5... Line -...
5
 
-
 
6
	const nbResultatsGregoire = 390;
-
 
7
	
-
 
8
	public function __construct() {
-
 
9
		$this->projet = 'images';
-
 
10
		$this->service = 'Images';
14
 
11
	}
15
	const nbResultatsGregoire = 409;
12
 
16
	
13
	public function testCoherenceResultat() {
17
	public function testCoherenceResultat() {
14
		$ressources = array();
18
		$url = $this->creerUrl('images');
Line 15... Line 19...
15
		$parametres = array();
19
		$i = new Images();
16
		$url = $this->creerUrl($ressources, $parametres);
20
		$retour = $this->consulterDirectJson($i->consulter([], []),
17
		$retour = $this->consulterJson($ressources, $parametres);
21
											$url);
Line 18... Line 22...
18
 
22
 
19
		$this->assertArrayHasKey('entete', $retour, "Le json ne contient pas d'attribut : entete. Voir : $url");
-
 
20
		$this->assertArrayHasKey('resultats', $retour, "Le json ne contient pas d'attribut : resultat. Voir : $url");
23
		$this->assertArrayHasKey('entete', $retour, "Le json ne contient pas d'attribut : entete. Voir : $url");
Line 21... Line 24...
21
	}
24
		$this->assertArrayHasKey('resultats', $retour, "Le json ne contient pas d'attribut : resultat. Voir : $url");
-
 
25
	}
22
 
26
 
-
 
27
	
Line -... Line 28...
-
 
28
	public function testNbObsEnFonctionDeLauteur() {
-
 
29
		$parametres = ['masque.auteur' => 'gregoire'];
23
	
30
		
24
	public function testNbObsEnFonctionDeLauteur() {
31
		$url = $this->creerUrl('images', $parametres);
25
		$ressources = array();
32
		$i = new Images();
26
		$parametres = array('masque.auteur' => 'gregoire');
33
		$retour = $this->consulterDirectJson($i->consulter([], $parametres),
27
		
34
											$url);