ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assClozeTestGUITest 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 assClozeTestGUITest:
+ Collaboration diagram for assClozeTestGUITest:

Public Member Functions

 testInstantiateObjectShouldReturnInstance ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIRSSMock ()
 
 getFileDeliveryMock ()
 
 getIliasMock ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 

Protected Attributes

 $backupGlobals = false
 
- Protected Attributes inherited from assBaseTestCase
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 Unit tests

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 26 of file assClozeTestGUITest.php.

Member Function Documentation

◆ setUp()

assClozeTestGUITest::setUp ( )
protected

Definition at line 30 of file assClozeTestGUITest.php.

References assBaseTestCase\addGlobal_uiFactory(), assBaseTestCase\addGlobal_uiRenderer(), assBaseTestCase\getGlobalTemplateMock(), and assBaseTestCase\setGlobalVariable().

30  : void
31  {
32  parent::setUp();
33 
34  $this->setGlobalVariable('ilLog', $this->createMock(ilLogger::class));
35 
36  $ilCtrl_mock = $this->getMockBuilder(ilCtrl::class)
37  ->disableOriginalConstructor()
38  ->getMock();
39  $ilCtrl_mock->method('saveParameter');
40  $ilCtrl_mock->method('saveParameterByClass');
41  $this->setGlobalVariable('ilCtrl', $ilCtrl_mock);
42 
43  $lng_mock = $this->getMockBuilder(ilLanguage::class)
44  ->disableOriginalConstructor()
45  ->onlyMethods(['txt'])
46  ->getMock();
47  $lng_mock->method('txt')->will($this->returnValue('Test'));
48  $this->setGlobalVariable('lng', $lng_mock);
49 
50  $ilias_mock = new stdClass();
51  $ilias_mock->account = new stdClass();
52  $ilias_mock->account->id = 6;
53  $ilias_mock->account->fullname = 'Esther Tester';
54 
55  $this->setGlobalVariable('ilias', $ilias_mock);
56  $this->setGlobalVariable('tpl', $this->getGlobalTemplateMock());
57  $this->addGlobal_uiFactory();
58  $this->addGlobal_uiRenderer();
59  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ testInstantiateObjectShouldReturnInstance()

assClozeTestGUITest::testInstantiateObjectShouldReturnInstance ( )

enabled

Definition at line 61 of file assClozeTestGUITest.php.

References assBaseTestCase\setGlobalVariable().

61  : void
62  {
68  // Act
69  $this->setGlobalVariable(
70  'ui.factory',
71  $this->getMockBuilder(\ILIAS\UI\Factory::class)
72  ->disableOriginalConstructor()
73  ->getMock()
74  );
75  $this->setGlobalVariable(
76  'ui.renderer',
77  $this->getMockBuilder(\ILIAS\UI\Renderer::class)
78  ->disableOriginalConstructor()
79  ->getMock()
80  );
81 
82  $instance = new assClozeTestGUI();
83  $this->assertInstanceOf('assClozeTestGUI', $instance);
84  }
Class ChatMainBarProvider .
Cloze test question GUI representation.
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

Field Documentation

◆ $backupGlobals

assClozeTestGUITest::$backupGlobals = false
protected

Definition at line 28 of file assClozeTestGUITest.php.


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