1 |
<?php
|
1 |
<?php
|
2 |
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
|
2 |
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
|
3 |
|
3 |
|
4 |
class NomsVernaculairesTest extends ConsultationEflorePhpUnit {
|
4 |
class NomsVernaculairesTest extends ConsultationEflorePhpUnit {
|
5 |
|
5 |
|
6 |
public function testRechercheEtendue() {
|
6 |
public function testRechercheEtendue() {
|
7 |
Registre::set('parametres.referentiel', 'nvjfl');
|
7 |
Registre::set('parametres.referentiel', 'nvjfl');
|
8 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
8 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
9 |
Config::charger($cheminRacine.'config.ini');
|
9 |
Config::charger($cheminRacine.'config.ini');
|
10 |
$noms = new NomsVernaculaires();
|
10 |
$noms = new NomsVernaculaires();
|
11 |
$resultats = $noms->getRechercheEtendue('abricotier');
|
11 |
$resultats = $noms->getRechercheEtendue('abricotier');
|
12 |
$this->assertNotEmpty($resultats);
|
12 |
$this->assertNotEmpty($resultats);
|
13 |
$this->assertEquals('3', $resultats['entete']['total']);
|
13 |
$this->assertEquals('3', $resultats['entete']['total']);
|
14 |
}
|
14 |
}
|
15 |
|
15 |
|
16 |
public function testRechercheEtendueDetermination() {
|
16 |
public function testRechercheEtendueDetermination() {
|
17 |
Registre::set('parametres.referentiel', 'nvjfl');
|
17 |
Registre::set('parametres.referentiel', 'nvjfl');
|
18 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
18 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
19 |
Config::charger($cheminRacine.'config.ini');
|
19 |
Config::charger($cheminRacine.'config.ini');
|
20 |
$noms = new NomsVernaculaires();
|
20 |
$noms = new NomsVernaculaires();
|
21 |
$resultats = $noms->getRechercheEtendue('abricotier', 'determination');
|
21 |
$resultats = $noms->getRechercheEtendue('abricotier', 'determination');
|
22 |
$this->assertNotEmpty($resultats);
|
22 |
$this->assertNotEmpty($resultats);
|
23 |
$this->assertEquals('3', $resultats['entete']['total']);
|
23 |
$this->assertEquals('3', $resultats['entete']['total']);
|
24 |
}
|
24 |
}
|
25 |
|
25 |
|
26 |
public function testRechercheFloue() {
|
26 |
public function testRechercheFloue() {
|
27 |
Registre::set('parametres.referentiel', 'nvjfl');
|
27 |
Registre::set('parametres.referentiel', 'nvjfl');
|
28 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
28 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
29 |
Config::charger($cheminRacine.'config.ini');
|
29 |
Config::charger($cheminRacine.'config.ini');
|
30 |
$noms = new NomsVernaculaires();
|
30 |
$noms = new NomsVernaculaires();
|
31 |
$resultats = $noms->getRechercheFloue('abricotier');
|
31 |
$resultats = $noms->getRechercheFloue('abricotier');
|
32 |
$this->assertNotEmpty($resultats);
|
32 |
$this->assertNotEmpty($resultats);
|
33 |
$this->assertEquals('5', $resultats['entete']['total']);
|
33 |
$this->assertEquals('1', $resultats['entete']['total']);
|
34 |
}
|
34 |
}
|
35 |
}
|
35 |
}
|
36 |
?>
|
36 |
?>
|