ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilResultsByQuestionTableGUITest Class Reference

Class ilResultsByQuestionTableGUITest. More...

+ Inheritance diagram for ilResultsByQuestionTableGUITest:
+ Collaboration diagram for ilResultsByQuestionTableGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testNumericOrdering ()
 
- Public Member Functions inherited from ilTestBaseTestCase
 createInstanceOf (string $class_name, array $explicit_parameters=[])
 
 createTraitInstanceOf (string $class_name, array $explicit_parameters=[])
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 

Private Attributes

ilResultsByQuestionTableGUI $tableGui
 
ilTestEvaluationGUI $parentObj_mock
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTestBaseTestCase
static callMethod ($obj, $name, array $args=[])
 
static getNonPublicPropertyValue (object $obj, string $name)
 
- Data Fields inherited from ilTestBaseTestCase
const string MOCKED_METHOD_WITHOUT_OUTPUT = 'MOCKED_METHOD_WITHOUT_OUTPUT'
 
const string DYNAMIC_CLASS = 'DynamicClass'
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 
Container $backup_dic = null
 
- Static Protected Attributes inherited from ilTestBaseTestCase
static int $DYNAMIC_CLASS_COUNT = 0
 

Detailed Description

Member Function Documentation

◆ setUp()

ilResultsByQuestionTableGUITest::setUp ( )
protected

Reimplemented from ilTestBaseTestCase.

Definition at line 30 of file ilResultsByQuestionTableGUITest.php.

30 : 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(ilTestEvaluationGUI::class)->disableOriginalConstructor()->onlyMethods(['getObject'])->getMock();
51 $this->parentObj_mock->method('getObject')->willReturn($this->getTestObjMock());
52 $this->tableGui = new ilResultsByQuestionTableGUI($this->parentObj_mock, "");
53 }
TableGUI class for results by question.
setGlobalVariable(string $name, mixed $value)

References getTestObjMock(), setGlobalVariable(), and setUp().

+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

ilResultsByQuestionTableGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 55 of file ilResultsByQuestionTableGUITest.php.

55 : void
56 {
57 $this->assertInstanceOf(ilResultsByQuestionTableGUI::class, $this->tableGui);
58 }

◆ testNumericOrdering()

ilResultsByQuestionTableGUITest::testNumericOrdering ( )

Definition at line 60 of file ilResultsByQuestionTableGUITest.php.

60 : void
61 {
62 $this->assertTrue($this->tableGui->numericOrdering("qid"));
63 $this->assertTrue($this->tableGui->numericOrdering("number_of_answers"));
64 $this->assertFalse($this->tableGui->numericOrdering("randomString"));
65 }

Field Documentation

◆ $parentObj_mock

ilTestEvaluationGUI ilResultsByQuestionTableGUITest::$parentObj_mock
private

Definition at line 28 of file ilResultsByQuestionTableGUITest.php.

◆ $tableGui

ilResultsByQuestionTableGUI ilResultsByQuestionTableGUITest::$tableGui
private

Definition at line 27 of file ilResultsByQuestionTableGUITest.php.


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