ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestEvaluationGUITest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
26 {
28 
29  protected function setUp(): void
30  {
31  parent::setUp();
32 
33  $this->addGlobal_lng();
34  $this->addGlobal_tpl();
35  $this->addGlobal_ilCtrl();
36  $this->addGlobal_ilias();
37  $this->addGlobal_tree();
38  $this->addGlobal_ilDB();
40  $this->addGlobal_ilTabs();
41  $this->addGlobal_ilObjDataCache();
42  $this->addGlobal_ilUser();
43 
44  $this->testObj = new ilTestEvaluationGUI($this->createMock(ilObjTest::class));
45  }
46 
48  {
49  $this->assertInstanceOf(ilTestEvaluationGUI::class, $this->testObj);
50  }
51 
52  public function testTestAccess(): void
53  {
54  $testAccess_mock = $this->createMock(ilTestAccess::class);
55 
56  $this->testObj->setTestAccess($testAccess_mock);
57 
58  $this->assertEquals($testAccess_mock, $this->testObj->getTestAccess());
59  }
60 
61  public function testGetEvaluationQuestionId(): void
62  {
63  $this->assertEquals(20, $this->testObj->getEvaluationQuestionId(20, 0));
64  $this->assertEquals(20, $this->testObj->getEvaluationQuestionId(20, -210));
65  $this->assertEquals(125, $this->testObj->getEvaluationQuestionId(20, 125));
66  }
67 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilTestBaseClass.