Exemplo n.º 1
0
 private function validateFields()
 {
     // Check mdp
     if (!$this->mdp) {
         $this->response_html .= '<p>Saisir mot de passe</p>';
         $this->response_status = 0;
     }
     // Check email
     if (!$this->email) {
         $this->response_html .= '<p>Saisir e-mail</p>';
         $this->response_status = 0;
     }
     // Check valid email
     if ($this->email && !$this->validateEmail()) {
         $this->response_html .= '<p>Saisir un e-mail valide</p>';
         $this->response_status = 0;
     } else {
         require_once 'modele/Membre.php';
         $manager = new MembresManager(null);
         if (!$manager->checkEmailDispo($this->email)) {
             $this->response_html .= '<p>Email déjà existant pour un autre utilisateur.</p>';
             $this->response_status = 0;
         }
     }
     if (strlen($this->marqueVeh) > 0) {
         if (strlen($this->modeleVeh) <= 0 || strlen($this->couleurVeh) <= 0 || !is_int($this->nbrPlaces) || !is_int($this->nbrPlaces)) {
             $this->response_html .= '<p>Si la marque est renseignée, bien renseignée tous les champs concernant le véhicule.</p>';
             $this->response_status = 0;
         }
     }
 }
Exemplo n.º 2
0
 /**
  * @depends testCreationBdd
  */
 public function testMembreMailDejaDansLaBase()
 {
     $membresManager = new MembresManager(null);
     $this->assertFalse($membresManager->checkEmailDispo("*****@*****.**"));
 }