Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1142 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?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']);
        }
        
}
?>