Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 825 | Rev 949 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 825 Rev 947
Line 96... Line 96...
96
	
96
	
97
	public function testParametreNavigationErrone() {
97
	public function testParametreNavigationErrone() {
98
		$ressources = array();
98
		$ressources = array();
99
		$parametresList = array(
99
		$parametresList = array(
100
			array('navigation.depart' => -5, 'navigation.limite' => 10 ),
100
			array('navigation.depart' => -5, 'navigation.limite' => 10 ),
101
			array('navigation.depart' => 0, 'navigation.limite' => abc ));
101
			array('navigation.depart' => 0, 'navigation.limite' => 'abc' ));
102
		$cles = array('navigation.depart','navigation.limite');
102
		$cles = array('navigation.depart','navigation.limite');
103
		$i = 0 ;
103
		$i = 0 ;
104
		foreach ($parametresList as $parametres) {
104
		foreach ($parametresList as $parametres) {
105
			$retour = ServiceEflorePhpUnit::consulterBrut($this->service, $this->projet, $ressources, $parametres);
105
			$retour = ServiceEflorePhpUnit::consulterBrut($this->service, $this->projet, $ressources, $parametres);
Line 145... Line 145...
145
		$parametres = array('navigation.depart' => 10, 'navigation.limite' => 15);
145
		$parametres = array('navigation.depart' => 10, 'navigation.limite' => 15);
146
			$url = ServiceEflorePhpUnit::creerUrl($this->service, $ressources, $parametres);
146
			$url = ServiceEflorePhpUnit::creerUrl($this->service, $ressources, $parametres);
147
			$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
147
			$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
148
			$this->assertArrayHasKey('entete', $retour, "Le json ne contient pas d'attribut : entete. Voir : $url");
148
			$this->assertArrayHasKey('entete', $retour, "Le json ne contient pas d'attribut : entete. Voir : $url");
149
			$this->assertArrayHasKey('resultats', $retour, "Le json ne contient pas d'attribut : resultat. Voir : $url");
149
			$this->assertArrayHasKey('resultats', $retour, "Le json ne contient pas d'attribut : resultat. Voir : $url");
150
			$this->verifierJsonEnteteBienFormeInformations($retour, $parametres);
150
			$this->verifierJsonEnteteBienFormeInformations($retour, $ressources, $parametres);
151
	}
151
	}
Line 152... Line 152...
152
	
152
	
153
	private function verifierJsonEnteteBienFormeInformations($retour, $parametres) {
153
	private function verifierJsonEnteteBienFormeInformations($retour, $ressources, $parametres) {
154
		//depart
154
		//depart
155
		$this->assertArrayHasKey('depart', $retour['entete'],
155
		$this->assertArrayHasKey('depart', $retour['entete'],
156
					"L'en-tĂȘte ne contient pas d'attribut : depart ");
156
					"L'en-tĂȘte ne contient pas d'attribut : depart ");
157
		$this->assertEquals($retour['entete']['depart'], $parametres['navigation.depart'],
157
		$this->assertEquals($retour['entete']['depart'], $parametres['navigation.depart'],
Line 192... Line 192...
192
		}
192
		}
193
	}
193
	}
Line 194... Line 194...
194
	
194
	
195
	public function testJsonNombreLimiteDemande() {
195
	public function testJsonNombreLimiteDemande() {
-
 
196
		$ressources = array();
196
		$ressources = array();
197
        $parametres = array();
197
		$parametresList = array('navigation.depart' => 10, 'navigation.limite' => 15 );
198
		$parametresList = array('navigation.depart' => 10, 'navigation.limite' => 15 );
198
			$url = ServiceEflorePhpUnit::creerUrl($this->service, $ressources, $parametres);
199
			$url = ServiceEflorePhpUnit::creerUrl($this->service, $ressources, $parametres);
199
			$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
200
			$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
200
			$this->assertLessThanOrEqual(15, count($retour), 
201
			$this->assertLessThanOrEqual(15, count($retour), 
Line 243... Line 244...
243
		}
244
		}
244
	}
245
	}
Line 245... Line 246...
245
				
246
				
246
	
-
 
247
	public function testJsonInformationsNNBasefor_max() {
-
 
248
		$ressources = array('bdtfx.nn:73256');
-
 
249
		$parametresList = array(
-
 
250
			array('retour.format' => 'max', 'categorie' => 'description'),
-
 
251
			array('retour.format' => 'max' , 'categorie' => 'ecologie'));
247
	
252
			foreach ($parametresList  as $parametres) {
-
 
253
				$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
248
	public function testJsonInformationsNNBasefor_max() {
254
				if ($parametres['categorie'] == 'description') {
249
        $retour = $this->consulterJson($this->service, $this->projet, ['bdtfx.nn:73256'], ['retour.format' => 'max', 'categorie' => 'description']);
-
 
250
        $this->verifierParametresDescription_max($retour);
255
					$this->verifierParametresDescription_max($retour);
251
 
256
				} else {
252
        $retour = $this->consulterJson($this->service, $this->projet, ['bdtfx.nn:73256'], ['retour.format' => 'max', 'categorie' => 'ecologie']);
257
					$this->verifierParametresEcologie_max($retour, 'baseflor');
-
 
258
				}
-
 
Line 259... Line 253...
259
			}
253
        $this->verifierParametresEcologie_max($retour, 'baseflor');
260
	}
254
	}
261
	
255
	
262
	public function testJsonInformationsNNRangSup_max() {
256
	public function testJsonInformationsNNRangSup_max() {
Line 333... Line 327...
333
		}
327
		}
334
	}
328
	}
Line 335... Line 329...
335
 
329
 
336
	public function testRelationsCatminat() {
330
	public function testRelationsCatminat() {
-
 
331
		$ressources = array('bdtfx.nn:5641', 'relations', 'catminat');
337
		$ressources = array('bdtfx.nn:5641', 'relations', 'catminat');
332
		$parametres = array();
Line 338... Line 333...
338
		$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
333
		$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
339
 
334
 
340
		// valeurs standards
335
		// valeurs standards