Blame | Last modification | View Log | RSS feed
<?phprequire_once dirname(__FILE__).'/../ServiceEflorePhpUnit.php';class ListeRougeCategorieTest extends ServiceEflorePhpUnit {public function __construct() {$this->projet = 'liste-rouge';$this->service = 'categorie';}public function testParametreMasqueNnExistant() {$ressources = array();$parametres = array('masque.nn'=>'3242');$retour = ServiceEflorePhpUnit::consulterJson($this->service, $this->projet, $ressources, $parametres);$retour_bool = is_array($retour) && isset($retour[0]) && isset($retour[0]['num_categorie']) && $retour[0]['num_categorie'] == 0;$this->assertEquals(true, $retour_bool,"Le service doit renvoyer des informations pour un masque.nn existant");}public function testParametreMasqueNnInexistant() {$ressources = array();$parametres = array('masque.nn'=>'1111');$retour = ServiceEflorePhpUnit::consulterJson($this->service, $this->projet, $ressources, $parametres);$retour_bool = is_array($retour) && empty($retour);$this->assertEquals(true, $retour_bool,"Le service doit renvoyer un tableau vide pour un masque.nn n'existant pas dans la base");}public function testParametreMasqueNnVide() {$ressources = array();$parametres = array('masque.nn'=>'');$retour = ServiceEflorePhpUnit::consulterBrut($this->service, $this->projet, $ressources, $parametres);$messageAttendu = "renseignez une valeur pour masque.nn<br />la valeur pour masque.nn doit être un entier";$this->assertEquals($messageAttendu, $retour,"Le service doit renvoyer un message pour un masque.nn vide");}public function testParametreMasqueNnNonPrecise() {$ressources = array();$parametres = array();$retour = ServiceEflorePhpUnit::consulterBrut($this->service, $this->projet, $ressources, $parametres);$messageAttendu = "renseignez une valeur pour masque.nn<br />la valeur pour masque.nn doit être un entier";$this->assertEquals($messageAttendu, $retour,"Le service doit renvoyer un message pour un masque.nn non renseigné");}public function testParametreMasqueNnNonNumerique() {$ressources = array();$parametres = array('masque.nn'=>'Acer');$retour = ServiceEflorePhpUnit::consulterBrut($this->service, $this->projet, $ressources, $parametres);$messageAttendu = "la valeur pour masque.nn doit être un entier";$this->assertEquals($messageAttendu, $retour,"Le service doit renvoyer un message pour un masque.nn non numérique");}}