exercise.lib.test.php 913 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. require_once api_get_path(SYS_CODE_PATH).'exercice/question.class.php';
  3. class TestExerciseLib extends UnitTestCase {
  4. /*public $eQuestion;
  5. public function TestExerciseLib() {
  6. $this->UnitTestCase('');
  7. }
  8. public function setUp() {
  9. $this->eQuestion = new Question();
  10. }
  11. public function tearDown() {
  12. $this->eQuestion = null;
  13. }*/
  14. /**
  15. * @param int question id
  16. * @param boolean only answers
  17. * @param boolean origin i.e = learnpath
  18. * @param int current item from the list of questions
  19. * @param int number of total questions
  20. */
  21. function testshowQuestion() {
  22. global $_course;
  23. $questionId = 1;
  24. $current_item = 1 ;
  25. $total_item = 1;
  26. //$objQuestionTmp = $question->read($questionId);
  27. $res = ExerciseLib::showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_item, $total_item);
  28. $this->assertTrue(is_null($res));
  29. var_dump($res);
  30. }
  31. }
  32. ?>