ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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

Reimplemented from assBaseTestCase.

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')->willReturn('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 }
setGlobalVariable(string $name, mixed $value)
addGlobal_uiRenderer()

References addGlobal_uiFactory(), addGlobal_uiRenderer(), and setGlobalVariable().

+ Here is the call graph for this function:

◆ testInstantiateObjectShouldReturnInstance()

assClozeTestGUITest::testInstantiateObjectShouldReturnInstance ( )

@runInSeparateProcess @preserveGlobalState 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.

References setGlobalVariable().

+ Here is the call graph for this function:

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: