139 |
delphine |
1 |
<?php
|
|
|
2 |
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
|
|
|
3 |
|
140 |
jpm |
4 |
class RechercheSimpleTest extends ConsultationEflorePhpUnit {
|
139 |
delphine |
5 |
public function testMoteurRechercheSimple() {
|
|
|
6 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
|
|
7 |
Config::charger($cheminRacine.'bdtfx.ini');
|
|
|
8 |
Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
|
|
|
9 |
Registre::set('parametres.referentiel', 'bdtfx');
|
140 |
jpm |
10 |
|
139 |
delphine |
11 |
$recherche = new RechercheSimple();
|
186 |
delphine |
12 |
|
|
|
13 |
$sortie = $recherche->executerFormulaireNom();
|
139 |
delphine |
14 |
|
|
|
15 |
$this->assertNotEmpty($sortie, print_r($sortie, true));
|
|
|
16 |
$this->assertContains('<input id="type-nom-scientifique" name="type_nom" type="hidden" value="nom_scientifique" />', $sortie, print_r($sortie,true));
|
204 |
delphine |
17 |
$this->assertContains('<input id="eflore_nomenclature_referentiel" name="referentiel" type="hidden" value="bdtfx" />', $sortie);
|
|
|
18 |
$this->assertContains('<input id="eflore_nomenclature_action" name="action" type="hidden" value="rechercheSimple" />', $sortie);
|
139 |
delphine |
19 |
$this->assertNotContains('<input id="type_nom_vernaculaire" name="type_nom" value="nom_vernaculaire" type="radio" checked="checked" />', $sortie);
|
|
|
20 |
}
|
140 |
jpm |
21 |
|
139 |
delphine |
22 |
public function testMoteurRechercheSimpleForm() {
|
|
|
23 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
|
|
24 |
Config::charger($cheminRacine.'bdtfx.ini');
|
|
|
25 |
Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
|
|
|
26 |
Registre::set('parametres.referentiel', 'bdtfx');
|
|
|
27 |
$donnees['type_nom'] = 'nom_vernaculaire';
|
|
|
28 |
$donnees['nom'] = 'acer';
|
|
|
29 |
$donnees['nom_verna'] = 'true';
|
140 |
jpm |
30 |
|
139 |
delphine |
31 |
$recherche = new RechercheSimple();
|
186 |
delphine |
32 |
$sortie = $recherche->executerFormulaireNom($donnees);
|
140 |
jpm |
33 |
|
139 |
delphine |
34 |
$this->assertNotEmpty($sortie, print_r($sortie, true));
|
|
|
35 |
$this->assertNotContains('<input id="type-nom-scientifique" name="type_nom" type="hidden" value="nom_scientifique" />', $sortie);
|
204 |
delphine |
36 |
$this->assertContains('<input id="eflore_nomenclature_referentiel" name="referentiel" type="hidden" value="bdtfx" />', $sortie);
|
|
|
37 |
$this->assertContains('<input id="eflore_nomenclature_action" name="action" type="hidden" value="rechercheSimple" />', $sortie);
|
139 |
delphine |
38 |
$this->assertContains('<input id="type_nom_vernaculaire" name="type_nom" value="nom_vernaculaire" type="radio" checked="checked" />', $sortie);
|
1063 |
raphael |
39 |
$this->assertContains('<input id="nom" name="nom" class="champ" size="30" maxlength="255" type="text" value="acer" />', $sortie);
|
140 |
jpm |
40 |
|
139 |
delphine |
41 |
}
|
|
|
42 |
}
|
|
|
43 |
?>
|