Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 1203 → Rev 1204

/tags/v5.3-cordier/tests/modules/NiveauTest.php
New file
0,0 → 1,33
<?php
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
 
class NiveauTest extends ConsultationEflorePhpUnit {
 
public function testAfficherNiveau() {
$_GET['referentiel'] = 'bdtfx';
$_GET['module'] = 'recherche';
$_GET['action'] = 'rechercheSimple';
$_GET['type_nom'] = 'nom_scientifique';
$_GET['nom'] = 'acer+mons';
Registre::set('parametres.niveau', '2');
$niveau = new Niveau($this->getAppUrls());
$sortie = $niveau->afficherNiveau();
 
$this->assertNotEmpty($sortie, $sortie);
$this->assertNotContains(' <input id="niveau_2" name="niveau" value="2" type="radio" checked="checked" />', $sortie);
$this->assertContains('<input id="eflore_niveau_type_nom" name="type_nom" type="hidden" value="nom_scientifique" />', $sortie, print_r($sortie,true));
$this->assertContains('<input id="eflore_niveau_referentiel" name="referentiel" type="hidden" value="bdtfx" />', $sortie);
$this->assertContains('<input id="eflore_niveau_action" name="action" type="hidden" value="rechercheSimple" />', $sortie);
$this->assertContains('<input id="eflore_niveau_nom" name="nom" type="hidden" value="acer+mons" />', $sortie);
}
protected function getAppUrls() {
$AppUrls = $this->getMock('AppUrls', array('obtenirUrlBase'), array(), '', false);
$AppUrls->expects($this->any())
->method('obtenirUrlBase')
->will($this->returnValue(ConsultationEflorePhpUnit::TPL_URL_BASE));
return $AppUrls;
}
}
?>