Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev Author Line No. Line
186 delphine 1
<?php
2
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
3
 
4
class NiveauTest extends ConsultationEflorePhpUnit {
5
 
6
	public function testAfficherNiveau() {
7
		$_GET['referentiel'] = 'bdtfx';
8
		$_GET['module'] = 'recherche';
9
		$_GET['action'] = 'rechercheSimple';
10
		$_GET['type_nom'] = 'nom_scientifique';
11
		$_GET['nom'] = 'acer+mons';
12
		Registre::set('parametres.niveau', '2');
13
		$niveau = new Niveau($this->getAppUrls());
14
 
15
		$sortie = $niveau->afficherNiveau();
16
 
1142 raphael 17
		$this->assertNotEmpty($sortie, $sortie);
186 delphine 18
		$this->assertNotContains(' <input id="niveau_2" name="niveau" value="2" type="radio" checked="checked" />', $sortie);
204 delphine 19
		$this->assertContains('<input id="eflore_niveau_type_nom" name="type_nom" type="hidden" value="nom_scientifique" />', $sortie, print_r($sortie,true));
20
		$this->assertContains('<input id="eflore_niveau_referentiel" name="referentiel" type="hidden" value="bdtfx" />', $sortie);
21
		$this->assertContains('<input id="eflore_niveau_action" name="action" type="hidden" value="rechercheSimple" />', $sortie);
22
		$this->assertContains('<input id="eflore_niveau_nom" name="nom" type="hidden" value="acer+mons" />', $sortie);
186 delphine 23
	}
24
 
25
	protected function getAppUrls() {
26
		$AppUrls = $this->getMock('AppUrls', array('obtenirUrlBase'), array(), '', false);
27
		$AppUrls->expects($this->any())
1142 raphael 28
				->method('obtenirUrlBase')
29
				->will($this->returnValue(ConsultationEflorePhpUnit::TPL_URL_BASE));
186 delphine 30
		return $AppUrls;
31
	}
32
}
33
?>