ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
assClozeTestGUITest Class Reference

Unit tests. 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 ()
 
 getIRSSMock ()
 

Protected Attributes

 $backupGlobals = false
 
- Protected Attributes inherited from assBaseTestCase
Container $dic = null
 

Detailed Description

Unit tests.

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

\

Definition at line 29 of file assClozeTestGUITest.php.

Member Function Documentation

◆ setUp()

assClozeTestGUITest::setUp ( )
protected

Definition at line 33 of file assClozeTestGUITest.php.

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

◆ testInstantiateObjectShouldReturnInstance()

assClozeTestGUITest::testInstantiateObjectShouldReturnInstance ( )

enabled

Definition at line 63 of file assClozeTestGUITest.php.

63  : void
64  {
70  $this->setGlobalVariable(
71  'ui.factory',
72  $this->getMockBuilder(Factory::class)
73  ->disableOriginalConstructor()
74  ->getMock()
75  );
76  $this->setGlobalVariable(
77  'ui.renderer',
78  $this->getMockBuilder(Renderer::class)
79  ->disableOriginalConstructor()
80  ->getMock()
81  );
82 
83  $instance = new assClozeTestGUI();
84  $this->assertInstanceOf(assClozeTestGUI::class, $instance);
85  }
Cloze test question GUI representation.

Field Documentation

◆ $backupGlobals

assClozeTestGUITest::$backupGlobals = false
protected

Definition at line 31 of file assClozeTestGUITest.php.


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