Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 204 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?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;
        }
}
?>