ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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  $this->setGlobalVariable('tpl', $this->getGlobalTemplateMock());
37  }
38 
39  /* Removed by @kergomard 17 NOV 2022, we should introduce this again
40  public function test_isComplete_shouldReturnTrue(): void
41  {
42  $obj = new assSingleChoice();
43  $this->assertEquals(false, $obj->isComplete());
44  $obj->setTitle('Tilte');
45  $obj->setAuthor('Me or another');
46  $obj->setQuestion('My great Question.');
47  $obj->addAnswer('Super simple single Choice', 1);
48 
49  $this->assertEquals(true, $obj->isComplete());
50  } */
51 
53  {
54  $obj = new assSingleChoice();
55  $this->assertEquals('thumb.', $obj->getThumbPrefix());
56  }
57 
59  {
60  $obj = new assSingleChoice();
61  $obj->setOutputType(0);
62  $this->assertEquals(0, $obj->getOutputType());
63  }
64 
65  /* Removed by @kergomard 17 NOV 2022, we should introduce this again
66  public function test_getAnswerCount_shouldReturnCount(): void
67  {
68  $obj = new assSingleChoice();
69  $this->assertEquals(0, $obj->getAnswerCount());
70  $obj->addAnswer('1', 1, 0);
71  $obj->addAnswer('1', 1, 1);
72  $this->assertEquals(2, $obj->getAnswerCount());
73  $obj->deleteAnswer(0);
74  $this->assertEquals(1, $obj->getAnswerCount());
75  }
76 
77  public function test_flushAnswers_shouldClearAnswers(): void
78  {
79  $obj = new assSingleChoice();
80  $obj->addAnswer('1', 1, 0);
81  $obj->addAnswer('1', 1, 1);
82  $this->assertEquals(2, $obj->getAnswerCount());
83  $obj->flushAnswers();
84  $this->assertEquals(0, $obj->getAnswerCount());
85  } */
86 
88  {
89  $obj = new assSingleChoice();
90  $this->assertEquals('assSingleChoice', $obj->getQuestionType());
91  }
92 
94  {
95  $obj = new assSingleChoice();
96  $this->assertEquals('qpl_qst_sc', $obj->getAdditionalTableName());
97  }
98 
100  {
101  $obj = new assSingleChoice();
102  $this->assertEquals('qpl_a_sc', $obj->getAnswerTableName());
103  }
104 }
Class assBaseTestCase.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_getAdditionalTableName_shouldReturnAdditionalTableName()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setGlobalVariable(string $name, $value)
test_getAnswerTableName_shouldReturnAnswerTableName()