Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 790 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 delphine 1
<?php
2
require_once dirname(__FILE__).'/../ServiceEflorePhpUnit.php';
3
 
4
class CommunAideTest extends ServiceEflorePhpUnit {
5
 
6
	public function __construct() {
784 raphael 7
		$this->projet = 'eflore';
240 delphine 8
		$this->service = 'aide';
9
	}
10
 
11
	public function testAideSurCommun() {
12
		$ressources = array();
13
		$parametres = array();
790 raphael 14
		$url = ServiceEflorePhpUnit::creerUrl($this->service, $ressources, $parametres);
15
		$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
784 raphael 16
		$this->assertNotEmpty($retour['PROJET EFLORE'], 'données absentes');
17
		$this->assertArrayHasKey('service.nom', $retour['PROJET EFLORE']['projet.services'][0], "Le json ne contient pas d'attribut : editeur. Voir : $url");
18
		$this->assertEquals('ontologies', $retour['PROJET EFLORE']['projet.services'][0]['service.nom'], "L'attribut 'editeur' devrait avoir la valeur 'Tela Botanica'. Voir : $url");
240 delphine 19
	}
20
 
21
	public function testAideProjets() {
22
		$ressources = array('projets');
23
		$parametres = array();
790 raphael 24
		$url = ServiceEflorePhpUnit::creerUrl($this->service, $ressources, $parametres);
25
		$retour = $this->consulterJson($this->service, $this->projet, $ressources, $parametres);
240 delphine 26
		$this->assertNotEmpty($retour, 'données absentes');
27
		$this->assertGreaterThanOrEqual(8, count($retour), $retour);
785 raphael 28
		$this->assertNotEmpty($retour['eflore'], 'données absentes');
29
		$this->assertArrayHasKey('service.nom', $retour['eflore']['projet.services'][0], "Le json ne contient pas d'attribut : editeur. Voir : $url");
30
		$this->assertEquals('ontologies', $retour['eflore']['projet.services'][0]['service.nom'], "L'attribut 'editeur' devrait avoir la valeur 'Tela Botanica'. Voir : $url");
240 delphine 31
 
32
	}
33
}
34
?>