Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev Author Line No. Line
50 jpm 1
<?php
2
class GenerateurNomSciHtmlTest extends PHPUnit_Framework_TestCase {
3
 
4
	public static function setUpBeforeClass() {
5
		error_reporting(E_ALL);
6
		define('DS', DIRECTORY_SEPARATOR);
7
		require_once dirname(__FILE__).DS.'..'.DS.'..'.DS.'modules'.DS.'bdtfx'.DS.'GenerateurNomSciHtml.php';
8
	}
9
 
10
	public function testGenerer() {
11
		$nomsDecomposes[] = array(
12
			'num_nom' => 1009,
13
			'rang' => 340,
14
			'nom_supra_generique' => '',
15
			'genre' => 'Aegilops',
16
			'epithete_infra_generique' => '',
17
			'epithete_sp' => 'triuncialis',
18
            'type_epithete' => 'var.',
19
            'epithete_infra_sp' => 'nigroferruginea',
20
            'cultivar_groupe' => '',
21
            'nom_commercial' => '',
22
            'cultivar' => '');
23
		$generateur = new GenerateurNomSciHtml();
24
		$nomsSciHtml = $generateur->generer($nomsDecomposes);
25
		$nomSciHtmlGenere = $nomsSciHtml[1009];
26
		$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>';
27
		$this->assertEquals($nomSciHtmlAttendu, $nomSciHtmlGenere);
28
	}
29
}
30
?>