ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
assClozeTestGUITest.php
Go to the documentation of this file.
1<?php
2
21
30{
31 protected $backupGlobals = false;
32
33 protected function setUp(): 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 }
62
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 }
86}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Class assBaseTestCase.
Cloze test question GUI representation.
setGlobalVariable(string $name, mixed $value)
addGlobal_uiRenderer()
An entity that renders components to a string output.
Definition: Renderer.php:31