ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilEvaluationAllTableGUITest Class Reference

Class ilEvaluationAllTableGUITest. 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_ilRbacAdmin ()
 
 addGlobal_ilCtrl ()
 
 addGlobal_lng ()
 
 addGlobal_filesystem ()
 
 addGlobal_upload ()
 
 addGlobal_ilDB ()
 
 addGlobal_ilBench ()
 
 addGlobal_ilLog ()
 
 addGlobal_ilias ()
 
 addGlobal_ilErr ()
 
 addGlobal_GlobalScreenService ()
 
 addGlobal_ilNavigationHistory ()
 
 addGlobal_ilAppEventHandler ()
 
 addGlobal_tpl ()
 
 addGlobal_ilComponentRepository ()
 
 addGlobal_ilComponentFactory ()
 
 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 ()
 
 addGlobal_skillService ()
 
 addGlobal_objectService ()
 
 addGlobal_resourceStorage ()
 
 getTestObjMock ()
 

Private Attributes

ilEvaluationAllTableGUI $tableGui
 
ilObjTestGUI $parentObj_mock
 

Additional Inherited Members

- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

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, "", $this->createMock(ilSetting::class));
63  }
TableGUI class for evaluation of all users.
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 121 of file ilEvaluationAllTableGUITest.php.

References ilEvaluationAllTableGUI\getSelectableColumns().

122  {
123  $expected = [
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  $this->createMock(ilSetting::class),
158  false,
159  false
160  );
161 
162  $this->assertEquals($expected, $tableGui->getSelectableColumns());
163 
165  $this->parentObj_mock,
166  "",
167  $this->createMock(ilSetting::class),
168  true,
169  false
170  );
171 
172  $this->assertEquals([], $tableGui->getSelectableColumns());
173  }
TableGUI class for evaluation of all users.
+ Here is the call graph for this function:

◆ testGetSelectedColumns()

ilEvaluationAllTableGUITest::testGetSelectedColumns ( )

Definition at line 175 of file ilEvaluationAllTableGUITest.php.

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

◆ testNumericOrdering()

ilEvaluationAllTableGUITest::testNumericOrdering ( )

Definition at line 70 of file ilEvaluationAllTableGUITest.php.

References ilEvaluationAllTableGUI\numericOrdering().

70  : void
71  {
73  $this->parentObj_mock,
74  "",
75  $this->createMock(ilSetting::class),
76  false,
77  false
78  );
79  $this->assertTrue($tableGui->numericOrdering("reached"));
80  $this->assertTrue($tableGui->numericOrdering("hint_count"));
81  $this->assertTrue($tableGui->numericOrdering("exam_id"));
82  $this->assertFalse($tableGui->numericOrdering("name"));
83 
85  $this->parentObj_mock,
86  "",
87  $this->createMock(ilSetting::class),
88  true,
89  true
90  );
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"));
95 
96  $tableGui = new ilEvaluationAllTableGUI(
97  $this->parentObj_mock,
98  "",
99  $this->createMock(ilSetting::class),
100  true,
101  false
102  );
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"));
107 
108  $tableGui = new ilEvaluationAllTableGUI(
109  $this->parentObj_mock,
110  "",
111  $this->createMock(ilSetting::class),
112  false,
113  true
114  );
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"));
119  }
TableGUI class for evaluation of all users.
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: