19 declare(strict_types=1);
30 protected function setUp(): void
34 $lng_mock = $this->createMock(ilLanguage::class);
35 $lng_mock->expects($this->any())
37 ->willReturnCallback(
function () {
38 return "testTranslation";
41 $ctrl_mock = $this->createMock(ilCtrl::class);
42 $ctrl_mock->expects($this->any())
43 ->method(
"getFormAction")
44 ->willReturnCallback(
function () {
45 return "testFormAction";
51 $this->
setGlobalVariable(
"component.repository", $this->createMock(ilComponentRepository::class));
52 $component_factory = $this->createMock(ilComponentFactory::class);
53 $component_factory->method(
"getActivePluginsInSlot")->willReturn(
new ArrayIterator());
60 $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(array(
'getObject'))->getMock();
61 $this->parentObj_mock->expects($this->any())->method(
'getObject')->willReturn($this->createMock(ilObjTest::class));
67 $this->assertInstanceOf(ilEvaluationAllTableGUI::class, $this->tableGui);
73 $this->parentObj_mock,
75 $this->createMock(ilSetting::class),
85 $this->parentObj_mock,
87 $this->createMock(ilSetting::class),
91 $this->assertTrue($tableGui->numericOrdering(
"reached"));
92 $this->assertTrue($tableGui->numericOrdering(
"hint_count"));
93 $this->assertTrue($tableGui->numericOrdering(
"exam_id"));
94 $this->assertTrue($tableGui->numericOrdering(
"name"));
97 $this->parentObj_mock,
99 $this->createMock(ilSetting::class),
103 $this->assertTrue($tableGui->numericOrdering(
"reached"));
104 $this->assertTrue($tableGui->numericOrdering(
"hint_count"));
105 $this->assertTrue($tableGui->numericOrdering(
"exam_id"));
106 $this->assertTrue($tableGui->numericOrdering(
"name"));
109 $this->parentObj_mock,
111 $this->createMock(ilSetting::class),
115 $this->assertTrue($tableGui->numericOrdering(
"reached"));
116 $this->assertTrue($tableGui->numericOrdering(
"hint_count"));
117 $this->assertTrue($tableGui->numericOrdering(
"exam_id"));
118 $this->assertFalse($tableGui->numericOrdering(
"name"));
125 "txt" =>
"testTranslation",
129 "txt" =>
"testTranslation",
133 "txt" =>
"testTranslation",
137 "txt" =>
"testTranslation",
141 "txt" =>
"testTranslation",
145 "txt" =>
"testTranslation",
149 "txt" =>
"testTranslation",
155 $this->parentObj_mock,
157 $this->createMock(ilSetting::class),
165 $this->parentObj_mock,
167 $this->createMock(ilSetting::class),
172 $this->assertEquals([], $tableGui->getSelectableColumns());
178 $this->assertEquals($expected, $this->tableGui->getSelectedColumns());
TableGUI class for evaluation of all users.
testGetSelectableColumns()
Class ilEvaluationAllTableGUITest.
setGlobalVariable(string $name, $value)
test_instantiateObject_shouldReturnInstance()
ilObjTestGUI $parentObj_mock
numericOrdering(string $a_field)
Should this field be sorted numeric?
ilEvaluationAllTableGUI $tableGui