ILIAS  release_8 Revision v8.23
ilTestDynamicQuestionSetStatisticTableGUITest 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 ilTestDynamicQuestionSetStatisticTableGUITest:
+ Collaboration diagram for ilTestDynamicQuestionSetStatisticTableGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testFilterSelection ()
 
 testInitTitle ()
 
 testTaxIds ()
 
 testAnswerStatusFilterEnabled ()
 
 testTaxonomyFilterEnabled ()
 

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

ilTestDynamicQuestionSetStatisticTableGUI $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 ilTestDynamicQuestionSetStatisticTableGUITest

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

Definition at line 25 of file ilTestDynamicQuestionSetStatisticTableGUITest.php.

Member Function Documentation

◆ setUp()

ilTestDynamicQuestionSetStatisticTableGUITest::setUp ( )
protected

Definition at line 30 of file ilTestDynamicQuestionSetStatisticTableGUITest.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  $ctrl_mock = $this->createMock(ilCtrl::class);
41  $ctrl_mock->expects($this->any())
42  ->method("getFormAction")
43  ->willReturnCallback(function () {
44  return "testFormAction";
45  });
46 
47  $this->setGlobalVariable("lng", $lng_mock);
48  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
49  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
50  $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
51  $component_factory = $this->createMock(ilComponentFactory::class);
52  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
53  $this->setGlobalVariable("component.factory", $component_factory);
54  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
55 
56  $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(array('getObject'))->getMock();
57  $this->parentObj_mock->expects($this->any())->method('getObject')->willReturn($this->createMock(ilObjTest::class));
58  $this->tableGui = new ilTestDynamicQuestionSetStatisticTableGUI(
59  $ctrl_mock,
60  $lng_mock,
61  $this->parentObj_mock,
62  "",
63  0
64  );
65  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

ilTestDynamicQuestionSetStatisticTableGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 67 of file ilTestDynamicQuestionSetStatisticTableGUITest.php.

67  : void
68  {
69  $this->assertInstanceOf(ilTestDynamicQuestionSetStatisticTableGUI::class, $this->tableGui);
70  }

◆ testAnswerStatusFilterEnabled()

ilTestDynamicQuestionSetStatisticTableGUITest::testAnswerStatusFilterEnabled ( )

Definition at line 97 of file ilTestDynamicQuestionSetStatisticTableGUITest.php.

97  : void
98  {
99  $this->assertIsBool($this->tableGui->isAnswerStatusFilterEnabled());
100  $this->tableGui->setAnswerStatusFilterEnabled(false);
101  $this->assertFalse($this->tableGui->isAnswerStatusFilterEnabled());
102  $this->tableGui->setAnswerStatusFilterEnabled(true);
103  $this->assertTrue($this->tableGui->isAnswerStatusFilterEnabled());
104  }

◆ testFilterSelection()

ilTestDynamicQuestionSetStatisticTableGUITest::testFilterSelection ( )

Definition at line 72 of file ilTestDynamicQuestionSetStatisticTableGUITest.php.

72  : void
73  {
74  $this->assertNull($this->tableGui->getFilterSelection());
75 
76  $this->tableGui->setFilterSelection(new ilTestDynamicQuestionSetFilterSelection());
77  $this->assertInstanceOf(
78  ilTestDynamicQuestionSetFilterSelection::class,
79  $this->tableGui->getFilterSelection()
80  );
81  }

◆ testInitTitle()

ilTestDynamicQuestionSetStatisticTableGUITest::testInitTitle ( )

Definition at line 83 of file ilTestDynamicQuestionSetStatisticTableGUITest.php.

83  : void
84  {
85  $this->tableGui->initTitle("tastas");
86  $this->assertEquals("testTranslation", $this->tableGui->title);
87  }

◆ testTaxIds()

ilTestDynamicQuestionSetStatisticTableGUITest::testTaxIds ( )

Definition at line 89 of file ilTestDynamicQuestionSetStatisticTableGUITest.php.

89  : void
90  {
91  $this->assertIsArray($this->tableGui->getTaxIds());
92  $expected = [10, 1250, 1233591, 12350];
93  $this->tableGui->setTaxIds($expected);
94  $this->assertEquals($expected, $this->tableGui->getTaxIds());
95  }

◆ testTaxonomyFilterEnabled()

ilTestDynamicQuestionSetStatisticTableGUITest::testTaxonomyFilterEnabled ( )

Definition at line 106 of file ilTestDynamicQuestionSetStatisticTableGUITest.php.

106  : void
107  {
108  $this->assertIsBool($this->tableGui->isTaxonomyFilterEnabled());
109  $this->tableGui->setTaxonomyFilterEnabled(false);
110  $this->assertFalse($this->tableGui->isTaxonomyFilterEnabled());
111  $this->tableGui->setTaxonomyFilterEnabled(true);
112  $this->assertTrue($this->tableGui->isTaxonomyFilterEnabled());
113  }

Field Documentation

◆ $parentObj_mock

ilObjTestGUI ilTestDynamicQuestionSetStatisticTableGUITest::$parentObj_mock
private

◆ $tableGui

ilTestDynamicQuestionSetStatisticTableGUI ilTestDynamicQuestionSetStatisticTableGUITest::$tableGui
private

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