Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 99 | 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 TaxonsTest extends ConsultationEflorePhpUnit {
5
 
6
	public function testStatsInitialesFamille() {
7
		Registre::set('parametres.referentiel', 'bdtfx');
8
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
9
		Config::charger($cheminRacine.'config.ini');
10
		$noms = new Taxons();
11
		$resultats = $noms->getStatsInitialesFamille();
12
		$this->assertNotEmpty($resultats);
13
		$this->assertEquals('24', $resultats['A']);
14
	}
15
 
16
	public function testStatsInitialesGenre() {
17
		Registre::set('parametres.referentiel', 'bdtfx');
18
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
19
		Config::charger($cheminRacine.'config.ini');
20
		$noms = new Taxons();
21
		$resultats = $noms->getStatsInitialesGenre();
22
		$this->assertNotEmpty($resultats);
23
		$this->assertEquals('9', $resultats['U']);
24
	}
25
 
26
	public function testListeFamilleParInitiale() {
27
		Registre::set('parametres.referentiel', 'bdtfx');
28
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
29
		Config::charger($cheminRacine.'config.ini');
30
		$noms = new Taxons();
31
		$resultats = $noms->getListeFamilleParInitiale('U');
32
		$this->assertNotEmpty($resultats);
33
		$this->assertCount(2, $resultats);
34
	}
35
 
36
	public function testListeGenreParInitiale() {
37
		Registre::set('parametres.referentiel', 'bdtfx');
38
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
39
		Config::charger($cheminRacine.'config.ini');
40
		$noms = new Taxons();
41
		$resultats = $noms->getListeGenreParInitiale('U');
42
		$this->assertNotEmpty($resultats);
43
		$this->assertNotEmpty($resultats[84640]);
44
		$this->assertCount(9, $resultats);
45
	}
46
 
47
	public function testRechercheEtendue() {
48
		Registre::set('parametres.referentiel', 'bdtfx');
49
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
50
		Config::charger($cheminRacine.'config.ini');
51
		$noms = new Taxons();
52
		$resultats = $noms->getRechercheEtendue('acer');
53
		$this->assertNotEmpty($resultats);
54
		$this->assertEquals('50', $resultats['entete']['total']);
55
	}
56
 
57
	public function testRechercheFloue() {
58
		Registre::set('parametres.referentiel', 'bdtfx');
59
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
60
		Config::charger($cheminRacine.'config.ini');
61
		$noms = new Taxons();
62
		$resultats = $noms->getRechercheFloue('aceras');
63
		$this->assertNotEmpty($resultats);
64
		$this->assertEquals('25', $resultats['entete']['total']);
65
	}
66
 
67
}
68
?>