ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
assSingleChoiceTest.php
Go to the documentation of this file.
1 <?php
2 
29 {
30  protected $backupGlobals = false;
31 
32  protected function setUp(): void
33  {
34  parent::setUp();
35  $this->setGlobalVariable('ilias', $this->getIliasMock());
36  }
37 
38  /* Removed by @kergomard 17 NOV 2022, we should introduce this again
39  public function test_isComplete_shouldReturnTrue(): void
40  {
41  $obj = new assSingleChoice();
42  $this->assertEquals(false, $obj->isComplete());
43  $obj->setTitle('Tilte');
44  $obj->setAuthor('Me or another');
45  $obj->setQuestion('My great Question.');
46  $obj->addAnswer('Super simple single Choice', 1);
47 
48  $this->assertEquals(true, $obj->isComplete());
49  } */
50 
52  {
53  $obj = new assSingleChoice();
54  $this->assertEquals('thumb.', $obj->getThumbPrefix());
55  }
56 
57  /* Removed by @kergomard 17 NOV 2022, we should introduce this again
58  public function test_getAnswerCount_shouldReturnCount(): void
59  {
60  $obj = new assSingleChoice();
61  $this->assertEquals(0, $obj->getAnswerCount());
62  $obj->addAnswer('1', 1, 0);
63  $obj->addAnswer('1', 1, 1);
64  $this->assertEquals(2, $obj->getAnswerCount());
65  $obj->deleteAnswer(0);
66  $this->assertEquals(1, $obj->getAnswerCount());
67  }
68 
69  public function test_flushAnswers_shouldClearAnswers(): void
70  {
71  $obj = new assSingleChoice();
72  $obj->addAnswer('1', 1, 0);
73  $obj->addAnswer('1', 1, 1);
74  $this->assertEquals(2, $obj->getAnswerCount());
75  $obj->flushAnswers();
76  $this->assertEquals(0, $obj->getAnswerCount());
77  } */
78 
80  {
81  $obj = new assSingleChoice();
82  $this->assertEquals('assSingleChoice', $obj->getQuestionType());
83  }
84 
86  {
87  $obj = new assSingleChoice();
88  $this->assertEquals('qpl_qst_sc', $obj->getAdditionalTableName());
89  }
90 
92  {
93  $obj = new assSingleChoice();
94  $this->assertEquals('qpl_a_sc', $obj->getAnswerTableName());
95  }
96 }
Class assBaseTestCase.
Class for single choice questions.
test_getAdditionalTableName_shouldReturnAdditionalTableName()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_getAnswerTableName_shouldReturnAnswerTableName()