Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 165 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
139 delphine 1
<?php
2
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
3
 
4
class RechercheTest extends ConsultationEflorePhpUnit {
5
 
6
	public function testExecuterRechercheSimple() {
7
		$_GET['type_nom'] = 'nom_scientifique';
8
		$_GET['nom'] = 'acer mons';
9
		$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
10
		Config::charger($cheminRacine.'bdtfx.ini');
11
		Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
12
		Registre::set('parametres.referentiel', 'bdtfx');
13
 
14
		$recherche = new Recherche();
15
		$recherche->initialiser();
16
		$recherche->executerRechercheSimple();
17
 
18
		$donnees = Registre::get('donneesMoteur');
19
		$resultat = Registre::get('resultats');
20
		$sortie = implode('', $recherche->getSortie());
21
		$this->assertEmpty($donnees, print_r($donnees, true));
22
		$this->assertNotEmpty($resultat, print_r($resultat, true));
23
		$this->assertEquals('6', $resultat['entete']['total']);
24
		$this->assertEquals('6', count($resultat['resultat']));
25
		$this->assertNotEmpty($sortie, print_r($sortie, true));
26
		$this->assertContains('<input id="nom" name="nom" class="champ" size="30" maxlength="255" type="text" autocomplete="off" value="acer mons" />', $sortie);
27
		$this->assertContains('<strong class="nom-sci-retenu"><span class="surlignage">Acer</span> <span class="surlignage">mons</span>pessullanum</strong>', $sortie);
28
 
29
	}
30
}
31
?>