ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilEvaluationAllTableGUITest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilEvaluationAllTableGUITest:
+ Collaboration diagram for ilEvaluationAllTableGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testNumericOrdering ()
 
 testGetSelectableColumns ()
 
 testGetSelectedColumns ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 
 addGlobal_ilAccess ()
 
 addGlobal_ilUser ()
 
 addGlobal_objDefinition ()
 
 addGlobal_tree ()
 
 addGlobal_ilSetting ()
 
 addGlobal_rbacsystem ()
 
 addGlobal_ilCtrl ()
 
 addGlobal_lng ()
 
 addGlobal_filesystem ()
 
 addGlobal_upload ()
 
 addGlobal_ilDB ()
 
 addGlobal_ilLog ()
 
 addGlobal_ilias ()
 
 addGlobal_ilErr ()
 
 addGlobal_ilAppEventHandler ()
 
 addGlobal_tpl ()
 
 addGlobal_ilComponentRepository ()
 
 addGlobal_ilTabs ()
 
 addGlobal_ilObjDataCache ()
 
 addGlobal_ilLocator ()
 
 addGlobal_rbacreview ()
 
 addGlobal_ilToolbar ()
 
 addGlobal_http ()
 
 addGlobal_ilIliasIniFile ()
 
 addGlobal_ilLoggerFactory ()
 
 addGlobal_ilHelp ()
 
 addGlobal_ui ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 
 addGlobal_refinery ()
 

Private Attributes

ilEvaluationAllTableGUI $tableGui
 
ilObjTestGUI $parentObj_mock
 

Additional Inherited Members

- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilEvaluationAllTableGUITest

Author
Marvin Beym mbeym.nosp@m.@dat.nosp@m.abay..nosp@m.de

Definition at line 25 of file ilEvaluationAllTableGUITest.php.

Member Function Documentation

◆ setUp()

ilEvaluationAllTableGUITest::setUp ( )
protected

Definition at line 30 of file ilEvaluationAllTableGUITest.php.

References ilTestBaseTestCase\setGlobalVariable().

30  : void
31  {
32  parent::setUp();
33 
34  $lng_mock = $this->createMock(ilLanguage::class);
35  $lng_mock->expects($this->any())
36  ->method("txt")
37  ->willReturnCallback(function () {
38  return "testTranslation";
39  });
40 
41  $ctrl_mock = $this->createMock(ilCtrl::class);
42  $ctrl_mock->expects($this->any())
43  ->method("getFormAction")
44  ->willReturnCallback(function () {
45  return "testFormAction";
46  });
47 
48  $this->setGlobalVariable("lng", $lng_mock);
49  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
50  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
51  $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
52  $component_factory = $this->createMock(ilComponentFactory::class);
53  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
54  $this->setGlobalVariable("component.factory", $component_factory);
55  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
56  $this->setGlobalVariable("ilSetting", $this->createMock(ilSetting::class));
57  $this->setGlobalVariable("rbacreview", $this->createMock(ilRbacReview::class));
58  $this->setGlobalVariable("ilUser", $this->createMock(ilObjUser::class));
59 
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));
62  $this->tableGui = new ilEvaluationAllTableGUI($this->parentObj_mock, "");
63  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

ilEvaluationAllTableGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 65 of file ilEvaluationAllTableGUITest.php.

65  : void
66  {
67  $this->assertInstanceOf(ilEvaluationAllTableGUI::class, $this->tableGui);
68  }

◆ testGetSelectableColumns()

ilEvaluationAllTableGUITest::testGetSelectableColumns ( )

Definition at line 117 of file ilEvaluationAllTableGUITest.php.

References ilEvaluationAllTableGUI\getSelectableColumns().

118  {
119  $expected = [
120  "gender" => [
121  "txt" => "testTranslation",
122  "default" => false,
123  ],
124  "email" => [
125  "txt" => "testTranslation",
126  "default" => false,
127  ],
128  "institution" => [
129  "txt" => "testTranslation",
130  "default" => false,
131  ],
132  "street" => [
133  "txt" => "testTranslation",
134  "default" => false,
135  ],
136  "city" => [
137  "txt" => "testTranslation",
138  "default" => false,
139  ],
140  "zipcode" => [
141  "txt" => "testTranslation",
142  "default" => false,
143  ],
144  "department" => [
145  "txt" => "testTranslation",
146  "default" => false,
147  ],
148  "matriculation" => [
149  "txt" => "testTranslation",
150  "default" => false,
151  ],
152  ];
153 
155  $this->parentObj_mock,
156  "",
157  false,
158  false
159  );
160 
161  $this->assertEquals($expected, $tableGui->getSelectableColumns());
162 
164  $this->parentObj_mock,
165  "",
166  true,
167  false
168  );
169 
170  $this->assertEquals([], $tableGui->getSelectableColumns());
171  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ testGetSelectedColumns()

ilEvaluationAllTableGUITest::testGetSelectedColumns ( )

Definition at line 173 of file ilEvaluationAllTableGUITest.php.

173  : void
174  {
175  $expected = [];
176  $this->assertEquals($expected, $this->tableGui->getSelectedColumns());
177  }

◆ testNumericOrdering()

ilEvaluationAllTableGUITest::testNumericOrdering ( )

Definition at line 70 of file ilEvaluationAllTableGUITest.php.

References ilEvaluationAllTableGUI\numericOrdering().

70  : void
71  {
73  $this->parentObj_mock,
74  "",
75  false,
76  false
77  );
78  $this->assertTrue($tableGui->numericOrdering("reached"));
79  $this->assertTrue($tableGui->numericOrdering("hint_count"));
80  $this->assertTrue($tableGui->numericOrdering("exam_id"));
81  $this->assertFalse($tableGui->numericOrdering("name"));
82 
84  $this->parentObj_mock,
85  "",
86  true,
87  true
88  );
89  $this->assertTrue($tableGui->numericOrdering("reached"));
90  $this->assertTrue($tableGui->numericOrdering("hint_count"));
91  $this->assertTrue($tableGui->numericOrdering("exam_id"));
92  $this->assertTrue($tableGui->numericOrdering("name"));
93 
94  $tableGui = new ilEvaluationAllTableGUI(
95  $this->parentObj_mock,
96  "",
97  true,
98  false
99  );
100  $this->assertTrue($tableGui->numericOrdering("reached"));
101  $this->assertTrue($tableGui->numericOrdering("hint_count"));
102  $this->assertTrue($tableGui->numericOrdering("exam_id"));
103  $this->assertTrue($tableGui->numericOrdering("name"));
104 
105  $tableGui = new ilEvaluationAllTableGUI(
106  $this->parentObj_mock,
107  "",
108  false,
109  true
110  );
111  $this->assertTrue($tableGui->numericOrdering("reached"));
112  $this->assertTrue($tableGui->numericOrdering("hint_count"));
113  $this->assertTrue($tableGui->numericOrdering("exam_id"));
114  $this->assertFalse($tableGui->numericOrdering("name"));
115  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
numericOrdering(string $a_field)
Should this field be sorted numeric?
+ Here is the call graph for this function:

Field Documentation

◆ $parentObj_mock

ilObjTestGUI ilEvaluationAllTableGUITest::$parentObj_mock
private

Definition at line 28 of file ilEvaluationAllTableGUITest.php.

◆ $tableGui

ilEvaluationAllTableGUI ilEvaluationAllTableGUITest::$tableGui
private

Definition at line 27 of file ilEvaluationAllTableGUITest.php.


The documentation for this class was generated from the following file: