Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 1203 → Rev 1204

/tags/v5.3-cordier/tests/metier/NomsTest.php
New file
0,0 → 1,60
<?php
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
 
class NomsTest extends ConsultationEflorePhpUnit {
public function testRechercheEtendue() {
Registre::set('parametres.referentiel', 'bdtfx');
Config::charger(CONFIG_DIR . '/config.ini');
$noms = new Noms();
$resultats = $noms->getRechercheEtendue('aceras');
$this->assertNotEmpty($resultats);
$this->assertEquals('15', $resultats['entete']['total']);
$this->assertNotEmpty($resultats['resultat']['243']);
$this->assertEquals('Aceras hircinum', $resultats['resultat']['243']['nom_sci']);
$this->assertArrayNotHasKey('nom_retenu.id', $resultats['resultat']['243']);
$this->assertArrayNotHasKey('auteur', $resultats['resultat']['243']);
$this->assertArrayNotHasKey('annee', $resultats['resultat']['243']);
$this->assertArrayNotHasKey('biblio_origine', $resultats['resultat']['243']);
}
public function testRechercheEtendueDetermination() {
Registre::set('parametres.referentiel', 'bdtfx');
Config::charger(CONFIG_DIR . '/config.ini');
$noms = new Noms();
$resultats = $noms->getRechercheEtendue('aceras', 'determination');
$this->assertNotEmpty($resultats);
$this->assertEquals('15', $resultats['entete']['total']);
$this->assertNotEmpty($resultats['resultat']['243']);
$this->assertEquals('Aceras hircinum', $resultats['resultat']['243']['nom_sci']);
$this->assertEquals('75170', $resultats['resultat']['243']['nom_retenu.id']);
$this->assertArrayNotHasKey('auteur', $resultats['resultat']['243']);
$this->assertArrayNotHasKey('annee', $resultats['resultat']['243']);
$this->assertArrayNotHasKey('biblio_origine', $resultats['resultat']['243']);
}
public function testRechercheEtendueDecompo() {
Registre::set('parametres.referentiel', 'bdtfx');
Config::charger(CONFIG_DIR . '/config.ini');
$noms = new Noms();
$resultats = $noms->getRechercheEtendue('aceras', 'decompo');
$this->assertNotEmpty($resultats);
$this->assertEquals('15', $resultats['entete']['total']);
$this->assertNotEmpty($resultats['resultat']['243']);
$this->assertEquals('Aceras hircinum', $resultats['resultat']['243']['nom_sci']);
$this->assertArrayNotHasKey('nom_retenu.id', $resultats['resultat']['243']);
$this->assertArrayHasKey('auteur', $resultats['resultat']['243']);
$this->assertArrayHasKey('annee', $resultats['resultat']['243']);
$this->assertArrayHasKey('biblio_origine', $resultats['resultat']['243']);
}
public function testRechercheFloue() {
Registre::set('parametres.referentiel', 'bdtfx');
Config::charger(CONFIG_DIR . '/config.ini');
$noms = new Noms();
$resultats = $noms->getRechercheFloue('aceras');
$this->assertNotEmpty($resultats);
$this->assertEquals('27', $resultats['entete']['total']);
}
}
?>