ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilTestSkillLevelThresholdsTableGUITest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
29
30 protected function setUp(): void
31 {
33
34 $lng_mock = $this->createMock(ilLanguage::class);
35 $ctrl_mock = $this->createMock(ilCtrl::class);
36 $ctrl_mock->method("getFormAction")
37 ->willReturnCallback(function () {
38 return "testFormAction";
39 });
40
41 $this->setGlobalVariable("lng", $lng_mock);
42 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
43 $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
44 $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
45 $component_factory = $this->createMock(ilComponentFactory::class);
46 $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
47 $this->setGlobalVariable("component.factory", $component_factory);
48 $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
49
50 $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(['getObject'])->getMock();
51 $this->parentObj_mock->method('getObject')->willReturn($this->getTestObjMock());
52 $this->tableGui = new ilTestSkillLevelThresholdsTableGUI(
53 $this->parentObj_mock,
54 0,
55 "",
56 $ctrl_mock,
57 $lng_mock
58 );
59 }
60
62 {
63 $this->assertInstanceOf(ilTestSkillLevelThresholdsTableGUI::class, $this->tableGui);
64 }
65
67 {
68 $this->assertIsBool($this->tableGui->areQuestionAssignmentColumnsEnabled());
69 $this->tableGui->setQuestionAssignmentColumnsEnabled(false);
70 $this->assertFalse($this->tableGui->areQuestionAssignmentColumnsEnabled());
71 $this->tableGui->setQuestionAssignmentColumnsEnabled(true);
72 $this->assertTrue($this->tableGui->areQuestionAssignmentColumnsEnabled());
73 }
74}
Class ilObjTestGUI.
Class ilTestBaseClass.
Class ilTestSkillLevelThresholdsTableGUITest.
setGlobalVariable(string $name, mixed $value)