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