Rev 139 | Rev 186 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?phprequire_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';class RechercheSimpleTest extends ConsultationEflorePhpUnit {public function testMoteurRechercheSimple() {$moteur = '<!-- DEBUT FORM_NOM --><script type="text/javascript"><!--var urlServiceAutocompletionNomsSci = "http://localhost/service:eflore:0.1/bdtfx/noms";var urlServiceAutocompletionNomsVerna = "";var urlBaseFicheTaxon = "http://localhost/opt/lampp/bin/phpunit?referentiel=bdtfx&module=fiche&action=fiche&nn={num_taxon}";var valeurDefautNomSci = "Rechercher un nom scientifique";var valeurDefautNomVerna = "Rechercher un nom commun";// --></script><form id="ef-form-nomenclature" name="ef-form-nomenclature" action="http://localhost/opt/lampp/bin/phpunit?referentiel=bdtfx&module=fiche&action=fiche&nn={num_taxon}" method="get" class="importance1"><fieldset><h1>Rechercher une plante</h1><span class="zone-choix-type-nom"><input id="type-nom-scientifique" name="type_nom" type="hidden" value="nom_scientifique" />Nom scientifique </span><input id="nom" name="nom" class="champ" size="30" maxlength="255" type="text" autocomplete="off" /><span id="zone-liens-recherche"><input id="referentiel" name="referentiel" type="hidden" value="bdtfx" /><input id="module" name="module" type="hidden" value="recherche" /><input id="action" name="action" type="hidden" value="rechercheSimple" /><input id="eflore_nomenclature_submit" name="submit" type="submit" value="OK" class="ok"/><input id="eflore_nomenclature_fiche" name="submit" type="submit" value="Accès fiche" /></span></fieldset></form><!-- FIN FORM_NOM -->';$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';Config::charger($cheminRacine.'bdtfx.ini');Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));Registre::set('parametres.referentiel', 'bdtfx');$recherche = new RechercheSimple();$recherche->executerAccueil();$sortie = implode('', $recherche->getSortie());$this->assertNotEmpty($sortie, print_r($sortie, true));$this->assertContains('<input id="type-nom-scientifique" name="type_nom" type="hidden" value="nom_scientifique" />', $sortie, print_r($sortie,true));$this->assertContains('<input id="referentiel" name="referentiel" type="hidden" value="bdtfx" />', $sortie);$this->assertContains('<input id="action" name="action" type="hidden" value="rechercheSimple" />', $sortie);$this->assertNotContains('<input id="type_nom_vernaculaire" name="type_nom" value="nom_vernaculaire" type="radio" checked="checked" />', $sortie);}public function testMoteurRechercheSimpleForm() {$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';Config::charger($cheminRacine.'bdtfx.ini');Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));Registre::set('parametres.referentiel', 'bdtfx');$donnees['type_nom'] = 'nom_vernaculaire';$donnees['nom'] = 'acer';$donnees['nom_verna'] = 'true';Registre::set('donneesMoteur', $donnees);$recherche = new RechercheSimple();$recherche->executerForm();$sortie = implode('', $recherche->getSortie());Registre::detruire('donneesMoteur');$this->assertNotEmpty($sortie, print_r($sortie, true));$this->assertNotContains('<input id="type-nom-scientifique" name="type_nom" type="hidden" value="nom_scientifique" />', $sortie);$this->assertContains('<input id="referentiel" name="referentiel" type="hidden" value="bdtfx" />', $sortie);$this->assertContains('<input id="action" name="action" type="hidden" value="rechercheSimple" />', $sortie);$this->assertContains('<input id="type_nom_vernaculaire" name="type_nom" value="nom_vernaculaire" type="radio" checked="checked" />', $sortie);$this->assertContains('<input id="nom" name="nom" class="champ" size="30" maxlength="255" type="text" autocomplete="off" value="acer" />', $sortie);}}?>