Line 4... |
Line 4... |
4 |
class RechercheTest extends ConsultationEflorePhpUnit {
|
4 |
class RechercheTest extends ConsultationEflorePhpUnit {
|
Line 5... |
Line 5... |
5 |
|
5 |
|
6 |
public function testExecuterRechercheSimple() {
|
6 |
public function testExecuterRechercheSimple() {
|
7 |
$_GET['type_nom'] = 'nom_scientifique';
|
7 |
$_GET['type_nom'] = 'nom_scientifique';
|
- |
|
8 |
$_GET['nom'] = 'acer mons';
|
8 |
$_GET['nom'] = 'acer mons';
|
9 |
|
9 |
Registre::set('niveau', '1');
|
10 |
Registre::set('niveau', '1');
|
10 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
11 |
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
|
11 |
Config::charger($cheminRacine.'bdtfx.ini');
|
12 |
Config::charger($cheminRacine.'bdtfx.ini');
|
12 |
Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
|
13 |
Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
|
Line 21... |
Line 22... |
21 |
$sortie = implode('', $recherche->getSortie());
|
22 |
$sortie = implode('', $recherche->getSortie());
|
22 |
$this->assertEmpty($donnees, print_r($donnees, true));
|
23 |
$this->assertEmpty($donnees, print_r($donnees, true));
|
23 |
$this->assertNotEmpty($resultat, print_r($resultat, true));
|
24 |
$this->assertNotEmpty($resultat, print_r($resultat, true));
|
24 |
$this->assertEquals('6', $resultat['entete']['total']);
|
25 |
$this->assertEquals('6', $resultat['entete']['total']);
|
25 |
$this->assertEquals('6', count($resultat['resultat']));
|
26 |
$this->assertEquals('6', count($resultat['resultat']));
|
26 |
$this->assertArrayHasNotKey('auteur', $resultat['resultat']['182']);
|
27 |
$this->assertArrayNotHasKey('auteur', $resultat['resultat']['182'], print_r($resultat, true));
|
27 |
$this->assertNotEmpty($sortie, print_r($sortie, true));
|
28 |
$this->assertNotEmpty($sortie, print_r($sortie, true));
|
28 |
$this->assertContains('<input id="nom" name="nom" class="champ" size="30" maxlength="255" type="text" autocomplete="off" value="acer mons" />', $sortie);
|
29 |
$this->assertContains('<input id="nom" name="nom" class="champ" size="30" maxlength="255" type="text" autocomplete="off" value="acer mons" />', $sortie);
|
29 |
$this->assertContains('<strong class="nom-sci-retenu"><span class="surlignage">Acer</span> <span class="surlignage">mons</span>pessullanum</strong>', $sortie);
|
30 |
$this->assertContains('<strong class="nom-sci-retenu"><span class="surlignage">Acer</span> <span class="surlignage">mons</span>pessulanum</strong>', $sortie);
|
30 |
}
|
31 |
}
|
Line 31... |
Line 32... |
31 |
|
32 |
|
32 |
public function testExecuterRechercheSimpleResDecompo() {
|
33 |
public function testExecuterRechercheSimpleResDecompo() {
|
33 |
$_GET['type_nom'] = 'nom_scientifique';
|
34 |
$_GET['type_nom'] = 'nom_scientifique';
|