You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.01-QCM_MuscuMaths/testUnit/testUnitaireQuestion.php

73 lines
2.1 KiB

<?php
require("../Website/class/Question.php") ;
print("<div align=\"center\"><font size=\"26\"><b>test question</b></font></div></br>") ;
$question = new Question("Damien Nortier", 24, 12, 3, 1) ;
print("test getContent.. ") ;
if($question->getContent() == "Damien Nortier"){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test getIdChapter.. ") ;
if($question->getIdChapter() == 24){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test getIdAnswerGood.. ") ;
if($question->getIdAnswerGood() == 12){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test setContent.. ") ;
$question->setContent("contenu") ;
if($question->getContent() == "contenu"){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test setIdAnswerGood.. ") ;
$question->setIdAnswerGood(1) ;
if($question->getIdAnswerGood() == 1){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test getDifficulty.. ") ;
if($question->getDifficulty() == 3){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test setDifficulty.. ") ;
$question->setDifficulty(24) ;
if($question->getDifficulty() == 24){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test getNbFails.. ") ;
if($question->getNbFails() == 1){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
print("test setNbFails.. ") ;
$question->setNbFails(13) ;
if($question->getNbFails() == 13){
print("<b><font color=\"green\">OK</font></b></br>") ;
}
else{
print("<b><font color=\"red\">ERREUR</font></b></br>") ;
}
?>