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');
1142 raphael 8
		Config::charger(CONFIG_DIR . '/config.ini');
99 delphine 9
		$noms = new Taxons();
10
		$resultats = $noms->getStatsInitialesFamille();
11
		$this->assertNotEmpty($resultats);
1142 raphael 12
		// bdtfx v2
13
		$this->assertEquals('25', $resultats['A']);
99 delphine 14
	}
15
 
16
	public function testStatsInitialesGenre() {
17
		Registre::set('parametres.referentiel', 'bdtfx');
1142 raphael 18
		Config::charger(CONFIG_DIR . '/config.ini');
99 delphine 19
		$noms = new Taxons();
20
		$resultats = $noms->getStatsInitialesGenre();
21
		$this->assertNotEmpty($resultats);
22
		$this->assertEquals('9', $resultats['U']);
23
	}
24
 
25
	public function testListeFamilleParInitiale() {
26
		Registre::set('parametres.referentiel', 'bdtfx');
1142 raphael 27
		Config::charger(CONFIG_DIR . '/config.ini');
99 delphine 28
		$noms = new Taxons();
29
		$resultats = $noms->getListeFamilleParInitiale('U');
30
		$this->assertNotEmpty($resultats);
31
		$this->assertCount(2, $resultats);
32
	}
33
 
34
	public function testListeGenreParInitiale() {
35
		Registre::set('parametres.referentiel', 'bdtfx');
1142 raphael 36
		Config::charger(CONFIG_DIR . '/config.ini');
99 delphine 37
		$noms = new Taxons();
38
		$resultats = $noms->getListeGenreParInitiale('U');
39
		$this->assertNotEmpty($resultats);
40
		$this->assertNotEmpty($resultats[84640]);
41
		$this->assertCount(9, $resultats);
42
	}
43
 
44
	public function testRechercheEtendue() {
45
		Registre::set('parametres.referentiel', 'bdtfx');
1142 raphael 46
		Config::charger(CONFIG_DIR . '/config.ini');
99 delphine 47
		$noms = new Taxons();
48
		$resultats = $noms->getRechercheEtendue('acer');
49
		$this->assertNotEmpty($resultats);
1142 raphael 50
		$this->assertEquals('49', $resultats['entete']['total']);
99 delphine 51
	}
1142 raphael 52
 
53
	/*
54
	  équivalent de:
55
	  SELECT count(num_nom) FROM bdtfx_v1_01 WHERE num_nom = num_nom_retenu AND (( SOUNDEX(nom_sci) = SOUNDEX('aceras')) OR ( SOUNDEX(REVERSE(nom_sci)) = SOUNDEX(REVERSE('aceras')))) LIMIT 0, 100;
56
	  ~/projets/services/modules/0.1/bdtfx/Taxons.php:275
57
	*/
99 delphine 58
	public function testRechercheFloue() {
59
		Registre::set('parametres.referentiel', 'bdtfx');
1142 raphael 60
		Config::charger(CONFIG_DIR . '/config.ini');
99 delphine 61
		$noms = new Taxons();
62
		$resultats = $noms->getRechercheFloue('aceras');
63
		$this->assertNotEmpty($resultats);
1142 raphael 64
		$this->assertEquals('15', $resultats['entete']['total']);
99 delphine 65
	}
66
 
67
}
68
?>