Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 98 → Rev 99

/trunk/tests/metier/EfloreTest.php
New file
0,0 → 1,20
<?php
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
 
class EfloreTest extends ConsultationEflorePhpUnit {
public function testFormulerUrl() {
$ressources = array('bdtfx', 'noms');
$parametres = array('masque' => 'acer', 'recherche' => 'stricte', 'ns.format' => 'htm');
$url = $this->creerUrl($ressources, $parametres);
$eflore = $this->getMock('Eflore');
$formaterUrl = self::getMethodeProtegee($eflore, 'formaterUrl');
$tpl = 'http://localhost/service:eflore:0.1/{projet}/noms?masque={valeur}&recherche={type}&ns.format=htm';
$param = array('projet' => 'bdtfx' ,'valeur' => 'acer', 'type' => 'stricte');
$urlf = $formaterUrl->invoke($eflore, $tpl, $param);
$this->assertEquals($url, $urlf);
}
}
?>
/trunk/tests/metier/NomsTest.php
New file
0,0 → 1,26
<?php
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
 
class NomsTest extends ConsultationEflorePhpUnit {
public function testRechercheEtendue() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Noms();
$resultats = $noms->getRechercheEtendue('aceras');
$this->assertNotEmpty($resultats);
$this->assertEquals('15', $resultats['entete']['total']);
}
public function testRechercheFloue() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Noms();
$resultats = $noms->getRechercheFloue('aceras');
$this->assertNotEmpty($resultats);
$this->assertEquals('27', $resultats['entete']['total']);
}
}
?>
/trunk/tests/metier/TaxonsTest.php
New file
0,0 → 1,68
<?php
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
 
class TaxonsTest extends ConsultationEflorePhpUnit {
public function testStatsInitialesFamille() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Taxons();
$resultats = $noms->getStatsInitialesFamille();
$this->assertNotEmpty($resultats);
$this->assertEquals('24', $resultats['A']);
}
public function testStatsInitialesGenre() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Taxons();
$resultats = $noms->getStatsInitialesGenre();
$this->assertNotEmpty($resultats);
$this->assertEquals('9', $resultats['U']);
}
public function testListeFamilleParInitiale() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Taxons();
$resultats = $noms->getListeFamilleParInitiale('U');
$this->assertNotEmpty($resultats);
$this->assertCount(2, $resultats);
}
public function testListeGenreParInitiale() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Taxons();
$resultats = $noms->getListeGenreParInitiale('U');
$this->assertNotEmpty($resultats);
$this->assertNotEmpty($resultats[84640]);
$this->assertCount(9, $resultats);
}
public function testRechercheEtendue() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Taxons();
$resultats = $noms->getRechercheEtendue('acer');
$this->assertNotEmpty($resultats);
$this->assertEquals('50', $resultats['entete']['total']);
}
public function testRechercheFloue() {
Registre::set('parametres.referentiel', 'bdtfx');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new Taxons();
$resultats = $noms->getRechercheFloue('aceras');
$this->assertNotEmpty($resultats);
$this->assertEquals('25', $resultats['entete']['total']);
}
}
?>
/trunk/tests/metier/NomsVernaculairesTest.php
New file
0,0 → 1,26
<?php
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
 
class NomsVernaculairesTest extends ConsultationEflorePhpUnit {
public function testRechercheEtendue() {
Registre::set('parametres.referentiel', 'nvjfl');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new NomsVernaculaires();
$resultats = $noms->getRechercheEtendue('abricotier');
$this->assertNotEmpty($resultats);
$this->assertEquals('3', $resultats['entete']['total']);
}
public function testRechercheFloue() {
Registre::set('parametres.referentiel', 'nvjfl');
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'config.ini');
$noms = new NomsVernaculaires();
$resultats = $noms->getRechercheFloue('abricotier');
$this->assertNotEmpty($resultats);
$this->assertEquals('5', $resultats['entete']['total']);
}
}
?>