Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 99 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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