Line 12... |
Line 12... |
12 |
* @copyright Copyright (c) 2011, 2013 Tela Botanica (accueil@tela-botanica.org)
|
12 |
* @copyright Copyright (c) 2011, 2013 Tela Botanica (accueil@tela-botanica.org)
|
13 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
|
13 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
|
14 |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
|
14 |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
|
15 |
*/
|
15 |
*/
|
Line -... |
Line 16... |
- |
|
16 |
|
16 |
|
17 |
define('CONFIG_DIR', __DIR__ . '/../configurations');
|
17 |
require_once __DIR__ . '/../framework.php';
|
18 |
require_once __DIR__ . '/../framework.php';
|
- |
|
19 |
abstract class ConsultationEflorePhpUnit extends PHPUnit_Framework_TestCase {
|
- |
|
20 |
const URL_API = 'http://localhost/service:eflore:0.1';
|
- |
|
21 |
const TPL_URL_BASE = 'http://localhost/consultation/index_botanique.php?referentiel=bdtfx';
|
- |
|
22 |
const TPL_URL_BASE_DOSSIER = 'http://localhost/consultation/';
|
Line 18... |
Line 23... |
18 |
abstract class ConsultationEflorePhpUnit extends PHPUnit_Framework_TestCase {
|
23 |
const TPL_URL_FICHE = 'http://localhost/consultation/index_botanique.php?referentiel=bdtfx&module=fiche&action=fiche&nn=%s';
|
19 |
|
24 |
|
Line 20... |
Line 25... |
20 |
//+------------------------------------------------------------------------------------------------------+
|
25 |
//+------------------------------------------------------------------------------------------------------+
|
Line 46... |
Line 51... |
46 |
if (class_exists($classe)) {
|
51 |
if (class_exists($classe)) {
|
47 |
return null;
|
52 |
return null;
|
48 |
}
|
53 |
}
|
Line 49... |
Line 54... |
49 |
|
54 |
|
- |
|
55 |
$cheminsTests = __DIR__.'/';
|
50 |
$cheminsTests = __DIR__.'/';
|
56 |
// $cheminBibliotheque = realpath(__DIR__.'/../bibliotheque/').'/';
|
51 |
$cheminMetier = realpath(__DIR__.'/../metier/api_0.1').'/';
|
57 |
$cheminMetier = realpath(__DIR__.'/../metier/api_0.1').'/';
|
- |
|
58 |
$cheminModule = realpath(__DIR__.'/../modules/').'/';
|
52 |
$cheminModule = realpath(__DIR__.'/../modules/').'/';
|
59 |
$cheminFormateurs = realpath(__DIR__.'/../modules/fiche/formateurs/').'/'; // pour FicheTest::testExecuterFiche()
|
53 |
$chemins = array($cheminMetier, $cheminModule, $cheminsTests);
|
60 |
$chemins = array(/* $cheminBibliotheque, */ $cheminMetier, $cheminModule, $cheminsTests, $cheminFormateurs);
|
54 |
foreach ($chemins as $chemin) {
|
61 |
foreach ($chemins as $chemin) {
|
55 |
$cheminCourt = $chemin.$classe.'.php';
|
62 |
$cheminCourt = $chemin.$classe.'.php';
|
56 |
$module = strtolower(preg_replace('/([A-Z])/', '_\\1', lcfirst($classe)));
|
63 |
$module = strtolower(preg_replace('/([A-Z])/', '_\\1', lcfirst($classe)));
|
57 |
$cheminLong = $chemin.$module.'/'.$classe.'.php';
|
64 |
$cheminLong = $chemin.$module.'/'.$classe.'.php';
|
Line 95... |
Line 102... |
95 |
$parametresUrl[] = $cle.'='.rawurlencode($valeur);
|
102 |
$parametresUrl[] = $cle.'='.rawurlencode($valeur);
|
96 |
}
|
103 |
}
|
97 |
$parametresUrl = '?'.implode('&', $parametresUrl);
|
104 |
$parametresUrl = '?'.implode('&', $parametresUrl);
|
98 |
}
|
105 |
}
|
Line 99... |
Line 106... |
99 |
|
106 |
|
100 |
return 'http://localhost/service:eflore:0.1'.$ressourcesUrl.$parametresUrl;
|
107 |
return self::URL_API.$ressourcesUrl.$parametresUrl;
|
Line 101... |
Line 108... |
101 |
}
|
108 |
}
|
102 |
|
109 |
|