Rev 60 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php
class GenerateurNomSciHtmlTest extends PHPUnit_Framework_TestCase {
public static function setUpBeforeClass() {
error_reporting(E_ALL);
define('DS', DIRECTORY_SEPARATOR);
require_once dirname(__FILE__).DS.'..'.DS.'..'.DS.'modules'.DS.'bdtfx'.DS.'GenerateurNomSciHtml.php';
}
public function testGenerer() {
$nomsDecomposes[] = array(
'num_nom' => 1009,
'rang' => 340,
'nom_supra_generique' => '',
'genre' => 'Aegilops',
'epithete_infra_generique' => '',
'epithete_sp' => 'triuncialis',
'type_epithete' => 'var.',
'epithete_infra_sp' => 'nigroferruginea',
'cultivar_groupe' => '',
'nom_commercial' => '',
'cultivar' => '');
$generateur = new GenerateurNomSciHtml();
$nomsSciHtml = $generateur->generer($nomsDecomposes);
$nomSciHtmlGenere = $nomsSciHtml[1009];
$nomSciHtmlAttendu = '<span class=sci><span class="gen">Aegilops</span> <span class="sp">triuncialis</span> <abbr class="type_epithete" title="Variété">var.</abbr> <span class="infra-sp">nigroferruginea</span></span>';
$this->assertEquals($nomSciHtmlAttendu, $nomSciHtmlGenere);
}
}
?>