/** * @group 57299 * Test that new Meeting created from module Calendar save in database correctly * * @dataProvider providerData * @return void */ public function testDisplaysMeetingWithStatusHeldInCalendar($status, $return_module) { $_POST = $this->getPostData(); $_POST['status'] = $status; $_POST['return_module'] = $return_module ? 'Calendar' : ''; $_REQUEST = $_POST; $this->formBase = new MeetingFormBase(); $this->bean = $this->formBase->handleSave('', false, false); $sql = "SELECT * FROM {$this->bean->rel_users_table} WHERE meeting_id = '" . $this->bean->id . "'"; $result = $this->bean->db->query($sql); $rows = $this->bean->db->fetchByAssoc($result); //assert that if we return name of Calendar module //create relation between created Meeting and current User if ($return_module) { $this->assertNotNull($rows); } else { $this->assertFalse($rows); } }
?> <h3>Informations extraites du formulaire :</h3><?php // Affiche les informations brutes xdump($form->ExtractValues()); // Affiche les informations, joli $form->DisplayHTML(); // remet le formulaire pour expérimentation $form->DisplayForm(); } break; case 6: $u = array('id' => '1', 'pseudo' => 'annonymous', 'password' => '', 'email' => '*****@*****.**', 'last_seen' => '1153046154', 'registered' => '1150799299', 'active' => '1', 'active_key' => '1150799299', 'icingdeath' => '0', 'gid' => '4'); $domain = array(1 => 'Administrateurs', 2 => 'Moderateurs', 3 => 'Membres', 4 => 'Annonymes'); $gu = array(1 => 4); $fields = array(new FormFieldString('pseudo', true, new FormValidatorString(5, 250), 'Pseudo :', $u['pseudo'], ''), new FormFieldPassword('password', true, new FormValidatorString(6, 20), 'Password :'******'password'], ''), new FormFieldString('email', true, new FormValidatorString(5, 250), 'E-mail :', $u['email'], ''), new FormFieldRadio('actif', true, false, 'Actif :', $u['active'], '', array(0 => 'Incatif', 1 => 'Actif')), new FormFieldMultiple('groupe', false, false, 'Groupe :', $gu, 'User groups', $domain)); $form = new FormBase('user_edit', url_from_get_vars(false), false, $fields); if ($form->Process()) { // Si on arrive ici, c'est que tout a été validé ?> <h3>Informations extraites du formulaire :</h3><?php // Affiche les informations brutes xdump($form->ExtractValues()); // Affiche les informations, joli $form->DisplayHTML(); // remet le formulaire pour expérimentation $form->DisplayForm(); } break; case 8: highlight_file(__FILE__); }