ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestQuestionBrowserTableGUITest 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 ilTestQuestionBrowserTableGUITest:
+ Collaboration diagram for ilTestQuestionBrowserTableGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testWriteAccess ()
 

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

ilTestQuestionBrowserTableGUI $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 ilTestQuestionBrowserTableGUITest

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

Definition at line 25 of file ilTestQuestionBrowserTableGUITest.php.

Member Function Documentation

◆ setUp()

ilTestQuestionBrowserTableGUITest::setUp ( )
protected

Definition at line 30 of file ilTestQuestionBrowserTableGUITest.php.

References ilTestBaseTestCase\setGlobalVariable().

30  : void
31  {
32  parent::setUp();
33 
34  $lng_mock = $this->createMock(ilLanguage::class);
35  $lng_mock
36  ->method("txt")
37  ->willReturnCallback(function () {
38  return "testTranslation";
39  });
40 
41  $ctrl_mock = $this->createMock(ilCtrl::class);
42  $ctrl_mock
43  ->method("getFormAction")
44  ->willReturnCallback(function () {
45  return "testFormAction";
46  });
47 
48  $mainTpl_mock = $this->createMock(ilGlobalPageTemplate::class);
49  $db_mock = $this->createMock(ilDBInterface::class);
50  $tree_mock = $this->createMock(ilTree::class);
51  $this->setGlobalVariable("lng", $lng_mock);
52  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
53  $this->setGlobalVariable("tpl", $mainTpl_mock);
54  $this->setGlobalVariable("tree", $tree_mock);
55  $this->setGlobalVariable("ilDB", $db_mock);
56  $this->setGlobalVariable("ilUser", $this->createMock(ilObjUser::class));
57  $this->setGlobalVariable("ilObjDataCache", $this->createMock(ilObjectDataCache::class));
58  $component_factory = $this->createMock(ilComponentFactory::class);
59  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
60  $this->setGlobalVariable("component.factory", $component_factory);
61 
62  $component_repository = $this->createMock(ilComponentRepository::class);
63  $this->setGlobalVariable("component.repository", $component_repository);
64 
65  $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(array('getObject'))->getMock();
66  $this->parentObj_mock->method('getObject')->willReturn($this->createMock(ilObjTest::class));
67  $this->tableGui = new ilTestQuestionBrowserTableGUI(
68  $ctrl_mock,
69  $mainTpl_mock,
70  $this->getMockBuilder(ilTabsGUI::class)->disableOriginalConstructor()->getMock(),
71  $lng_mock,
72  $tree_mock,
73  $db_mock,
74  $component_repository,
75  $this->getMockBuilder(ilObjTest::class)->disableOriginalConstructor()->getMock(),
76  $this->createMock(ilAccessHandler::class),
77  $this->createMock(\ILIAS\HTTP\GlobalHttpState::class),
78  new \ILIAS\Refinery\Factory(
79  new \ILIAS\Data\Factory(),
80  $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock()
81  ),
82  $this->createMock(ILIAS\UI\Factory::class),
83  $this->createMock(ILIAS\UI\Renderer::class),
84  );
85  }
Class Factory.
Class ChatMainBarProvider .
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

ilTestQuestionBrowserTableGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 87 of file ilTestQuestionBrowserTableGUITest.php.

87  : void
88  {
89  $this->assertInstanceOf(ilTestQuestionBrowserTableGUI::class, $this->tableGui);
90  }

◆ testWriteAccess()

ilTestQuestionBrowserTableGUITest::testWriteAccess ( )

Definition at line 92 of file ilTestQuestionBrowserTableGUITest.php.

92  : void
93  {
94  $this->tableGui->setWriteAccess(false);
95  $this->assertFalse($this->tableGui->hasWriteAccess());
96  $this->tableGui->setWriteAccess(true);
97  $this->assertTrue($this->tableGui->hasWriteAccess());
98  }

Field Documentation

◆ $parentObj_mock

ilObjTestGUI ilTestQuestionBrowserTableGUITest::$parentObj_mock
private

Definition at line 28 of file ilTestQuestionBrowserTableGUITest.php.

◆ $tableGui

ilTestQuestionBrowserTableGUI ilTestQuestionBrowserTableGUITest::$tableGui
private

Definition at line 27 of file ilTestQuestionBrowserTableGUITest.php.


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