2,7 → 2,6 |
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php'; |
|
class NiveauTest extends ConsultationEflorePhpUnit { |
const TPL_URL_BASE = 'http://localhost/eflore/eflore-consultation/index_botanique.php?referentiel=bdtfx'; |
|
public function testAfficherNiveau() { |
$_GET['referentiel'] = 'bdtfx'; |
15,7 → 14,7 |
|
$sortie = $niveau->afficherNiveau(); |
|
$this->assertNotEmpty($sortie, print_r($sortie, true)); |
$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); |
26,12 → 25,9 |
protected function getAppUrls() { |
$AppUrls = $this->getMock('AppUrls', array('obtenirUrlBase'), array(), '', false); |
$AppUrls->expects($this->any()) |
->method('obtenirUrlBase') |
->will($this->returnCallback(array($this, 'genererUrlBase'))); |
->method('obtenirUrlBase') |
->will($this->returnValue(ConsultationEflorePhpUnit::TPL_URL_BASE)); |
return $AppUrls; |
} |
public function genererUrlBase($id) { |
return sprintf(self::TPL_URL_BASE, $id); |
} |
} |
?> |