Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 165 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
99 delphine 1
<?php
2
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
3
 
4
class NomsTest extends ConsultationEflorePhpUnit {
5
 
6
	public function testRechercheEtendue() {
7
		Registre::set('parametres.referentiel', 'bdtfx');
8
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
9
		Config::charger($cheminRacine.'config.ini');
10
		$noms = new Noms();
11
		$resultats = $noms->getRechercheEtendue('aceras');
12
		$this->assertNotEmpty($resultats);
13
		$this->assertEquals('15', $resultats['entete']['total']);
165 delphine 14
		$this->assertNotEmpty($resultats['resultat']['243']);
1138 raphael 15
		$this->assertEquals('Aceras hircinum', $resultats['resultat']['243']['nom_sci']);
165 delphine 16
		$this->assertArrayNotHasKey('nom_retenu.id', $resultats['resultat']['243']);
17
		$this->assertArrayNotHasKey('auteur', $resultats['resultat']['243']);
18
		$this->assertArrayNotHasKey('annee', $resultats['resultat']['243']);
19
		$this->assertArrayNotHasKey('biblio_origine', $resultats['resultat']['243']);
99 delphine 20
	}
21
 
165 delphine 22
	public function testRechercheEtendueDetermination() {
23
		Registre::set('parametres.referentiel', 'bdtfx');
24
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
25
		Config::charger($cheminRacine.'config.ini');
26
		$noms = new Noms();
27
		$resultats = $noms->getRechercheEtendue('aceras', 'determination');
28
		$this->assertNotEmpty($resultats);
29
		$this->assertEquals('15', $resultats['entete']['total']);
30
		$this->assertNotEmpty($resultats['resultat']['243']);
1138 raphael 31
		$this->assertEquals('Aceras hircinum', $resultats['resultat']['243']['nom_sci']);
32
		$this->assertEquals('75170', $resultats['resultat']['243']['nom_retenu.id']);
165 delphine 33
		$this->assertArrayNotHasKey('auteur', $resultats['resultat']['243']);
34
		$this->assertArrayNotHasKey('annee', $resultats['resultat']['243']);
35
		$this->assertArrayNotHasKey('biblio_origine', $resultats['resultat']['243']);
36
	}
37
 
38
	public function testRechercheEtendueDecompo() {
39
		Registre::set('parametres.referentiel', 'bdtfx');
40
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
41
		Config::charger($cheminRacine.'config.ini');
42
		$noms = new Noms();
43
		$resultats = $noms->getRechercheEtendue('aceras', 'decompo');
44
		$this->assertNotEmpty($resultats);
45
		$this->assertEquals('15', $resultats['entete']['total']);
46
		$this->assertNotEmpty($resultats['resultat']['243']);
1138 raphael 47
		$this->assertEquals('Aceras hircinum', $resultats['resultat']['243']['nom_sci']);
165 delphine 48
		$this->assertArrayNotHasKey('nom_retenu.id', $resultats['resultat']['243']);
49
		$this->assertArrayHasKey('auteur', $resultats['resultat']['243']);
50
		$this->assertArrayHasKey('annee', $resultats['resultat']['243']);
51
		$this->assertArrayHasKey('biblio_origine', $resultats['resultat']['243']);
52
	}
53
 
99 delphine 54
	public function testRechercheFloue() {
55
		Registre::set('parametres.referentiel', 'bdtfx');
56
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
57
		Config::charger($cheminRacine.'config.ini');
58
		$noms = new Noms();
59
		$resultats = $noms->getRechercheFloue('aceras');
60
		$this->assertNotEmpty($resultats);
61
		$this->assertEquals('27', $resultats['entete']['total']);
62
	}
63
}
64
?>