Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 1359 → Rev 1360

/trunk/services/tests/0.1/ServiceDelPhpUnit.php
1,5 → 1,4
<?php
// declare(encoding='UTF-8');
/**
* Classe contenant des méthodes :
* - d'intialisation des tests,
6,14 → 5,15
* - refactorisant le code des tests,
* - facilitant les tests.
*
* @category php 5.3
* @category php 5.4
* @package Tests/Services
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2011, Tela Botanica (accueil@tela-botanica.org)
* @author Raphaël Droz <raphael@tela-botanica.org>
* @copyright Copyright (c) 2011, 2013 Tela Botanica (accueil@tela-botanica.org)
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version $Id$
*/
 
abstract class ServiceDelPhpUnit extends PHPUnit_Framework_TestCase {
 
/** Définir la valeur de cet attribut dans le constructeur de la classe de test.*/
73,15 → 73,25
return $retour;
}
 
public function consulterDirectJson($json, $url) {
$retour = json_decode($json, true);
$this->assertEquals(JSON_ERROR_NONE,
json_last_error(),
"Le json contient des erreurs qui bloquent le décodage. Voir : $url\n" .
print_r($json, true));
return $retour;
}
 
protected function consulterBrut($ressources, $parametres) {
array_unshift($ressources, $this->service);
array_unshift($ressources, $this->projet);
$projets = new Del();
$projets = new Determinations();
$retourJson = $projets->consulter($ressources, $parametres);
return $retourJson;
}
 
protected function creerUrl($ressources, $parametres) {
 
protected function creerUrl($ressources, $parametres = []) {
$version = '';
$ressourcesUrl = array();
foreach ($ressources as $ressource) {