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