319 |
// résultat attendu |
// résultat attendu |
320 |
$di = 'PC01'; |
$di = 'PC01'; |
321 |
$inst = 7; |
$inst = 7; |
322 |
$url = 'http://localhost/openads/spg/direct_link.php?obj=dossier_instruction&action=3'; |
$url = 'http://localhost/openads/app/index.php?module=form&direct_link=true&obj=dossier_instruction&action=3'; |
323 |
$url .= '&direct_field=dossier&direct_form=instruction&direct_action=3&direct_idx='.$inst; |
$url .= '&direct_field=dossier&direct_form=instruction&direct_action=3&direct_idx='.$inst; |
324 |
$link = '<a href="'.$url.'">'.$url.'</a>'; |
$link = '<a href="'.$url.'">'.$url.'</a>'; |
325 |
$expected = 'DI : '.$di.'<br/>'; |
$expected = 'DI : '.$di.'<br/>'; |
326 |
$expected .= 'LIEN : '.$link.'<br/>'; |
$expected .= 'LIEN : '.$link.'<br/>'; |
327 |
$expected .= 'INSTRUCTION : '.$inst; |
$expected .= 'INSTRUCTION : '.$inst; |
328 |
// Instance de la classe instruction |
// Instance de la classe instruction |
329 |
require_once "../obj/instruction.class.php"; |
$instr = $f->get_inst__om_dbform(array( |
330 |
$instr = new instruction(']', $f->db, DEBUG); |
"obj" => "instruction", |
331 |
|
"idx" => "]", |
332 |
|
)); |
333 |
// Traitement |
// Traitement |
334 |
$result = $instr->formater_modele($template, $di, $inst); |
$result = $instr->formater_modele($template, $di, $inst); |
335 |
// Vérification du traitement |
// Vérification du traitement |
355 |
$f->disableLog(); |
$f->disableLog(); |
356 |
$GLOBALS["f"] = $f; |
$GLOBALS["f"] = $f; |
357 |
|
|
358 |
require_once "../obj/om_requete.class.php"; |
$om_requete = $f->get_inst__om_dbform(array( |
359 |
$om_requete = new om_requete(7); |
"obj" => "om_requete", |
360 |
|
"idx" => 7, |
361 |
|
)); |
362 |
|
|
363 |
// récupération de la requête SQL |
// récupération de la requête SQL |
364 |
$sql = $om_requete->getVal('requete'); |
$sql = $om_requete->getVal('requete'); |
394 |
$f = new utils("nohtml"); |
$f = new utils("nohtml"); |
395 |
$f->disableLog(); |
$f->disableLog(); |
396 |
$GLOBALS["f"] = $f; |
$GLOBALS["f"] = $f; |
397 |
require_once "../obj/dossier_message.class.php"; |
$dossier_message_factory = $f->get_inst__om_dbform(array( |
398 |
$dossier_message_factory = new dossier_message(0, $f->db, 0); |
"obj" => "dossier_message", |
399 |
|
"idx" => 0, |
400 |
|
)); |
401 |
$dossier_message_val = array(); |
$dossier_message_val = array(); |
402 |
|
|
403 |
$dossier_message_val['contenu'] = 'Test Success'; |
$dossier_message_val['contenu'] = 'Test Success'; |
409 |
$add = $dossier_message_factory->add_notification_message($dossier_message_val); |
$add = $dossier_message_factory->add_notification_message($dossier_message_val); |
410 |
$this->assertEquals(true, $add); |
$this->assertEquals(true, $add); |
411 |
$this->assertEquals(true, isset($dossier_message_factory->valF[$dossier_message_factory->clePrimaire])); |
$this->assertEquals(true, isset($dossier_message_factory->valF[$dossier_message_factory->clePrimaire])); |
412 |
$dossier_message = new dossier_message($dossier_message_factory->valF[$dossier_message_factory->clePrimaire], $f->db, 0); |
$dossier_message = $f->get_inst__om_dbform(array( |
413 |
|
"obj" => "dossier_message", |
414 |
|
"idx" => $dossier_message_factory->valF[$dossier_message_factory->clePrimaire], |
415 |
|
)); |
416 |
$this->assertEquals($dossier_message_val['dossier'], $dossier_message->getVal('dossier')); |
$this->assertEquals($dossier_message_val['dossier'], $dossier_message->getVal('dossier')); |
417 |
$this->assertEquals('t', $dossier_message->getVal('lu')); |
$this->assertEquals('t', $dossier_message->getVal('lu')); |
418 |
|
|
431 |
$dossier_message_val['login'] = $_SESSION['login']; |
$dossier_message_val['login'] = $_SESSION['login']; |
432 |
$add = $dossier_message_factory->add_notification_message($dossier_message_val); |
$add = $dossier_message_factory->add_notification_message($dossier_message_val); |
433 |
$this->assertEquals(true, $add); |
$this->assertEquals(true, $add); |
434 |
$dossier_message = new dossier_message($dossier_message_factory->valF[$dossier_message_factory->clePrimaire], $f->db, 0); |
$dossier_message = $f->get_inst__om_dbform(array( |
435 |
|
"obj" => "dossier_message", |
436 |
|
"idx" => $dossier_message_factory->valF[$dossier_message_factory->clePrimaire], |
437 |
|
)); |
438 |
$this->assertEquals('f', $dossier_message->getVal('lu')); |
$this->assertEquals('f', $dossier_message->getVal('lu')); |
439 |
|
|
440 |
// Destruction de la classe Utils |
// Destruction de la classe Utils |