99 |
delphine |
1 |
<?php
|
|
|
2 |
require_once dirname(__FILE__).'/../ConsultationEflorePhpUnit.php';
|
|
|
3 |
|
|
|
4 |
class EfloreTest extends ConsultationEflorePhpUnit {
|
|
|
5 |
|
|
|
6 |
public function testFormulerUrl() {
|
|
|
7 |
$ressources = array('bdtfx', 'noms');
|
|
|
8 |
$parametres = array('masque' => 'acer', 'recherche' => 'stricte', 'ns.format' => 'htm');
|
|
|
9 |
$url = $this->creerUrl($ressources, $parametres);
|
|
|
10 |
|
|
|
11 |
$eflore = $this->getMock('Eflore');
|
|
|
12 |
$formaterUrl = self::getMethodeProtegee($eflore, 'formaterUrl');
|
|
|
13 |
$tpl = 'http://localhost/service:eflore:0.1/{projet}/noms?masque={valeur}&recherche={type}&ns.format=htm';
|
|
|
14 |
$param = array('projet' => 'bdtfx' ,'valeur' => 'acer', 'type' => 'stricte');
|
|
|
15 |
$urlf = $formaterUrl->invoke($eflore, $tpl, $param);
|
|
|
16 |
|
|
|
17 |
$this->assertEquals($url, $urlf);
|
|
|
18 |
}
|
|
|
19 |
}
|
|
|
20 |
?>
|