ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestRandomQuestionSetPoolDefinitionFormGUITest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
28
29 protected function setUp(): void
30 {
31 parent::setUp();
32 $ctrl_mock = $this->createMock(ilCtrl::class);
33 $lng_mock = $this->createMock(ilLanguage::class);
34
35 $this->setGlobalVariable("lng", $lng_mock);
36 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
37
38 $testRandomQuestionSetConfigGUI_mock = $this->getMockBuilder(
39 ilTestRandomQuestionSetConfigGUI::class
40 )->disableOriginalConstructor()->getMock();
41
42 $testRandomQuestionSetConfig_mock = $this->getMockBuilder(
43 ilTestRandomQuestionSetConfig::class,
44 )->disableOriginalConstructor()->getMock();
45
47 $ctrl_mock,
48 $lng_mock,
49 $this->getTestObjMock(),
50 $testRandomQuestionSetConfigGUI_mock,
51 $testRandomQuestionSetConfig_mock
52 );
53 }
54
56 {
57 $this->assertInstanceOf(ilTestRandomQuestionSetPoolDefinitionFormGUI::class, $this->formGui);
58 }
59
60 protected function testSaveCommand(): void
61 {
62 $expected = 'testCommand';
63
64 $this->formGui->setSaveCommand($expected);
65
66 $this->assertEquals($expected, $this->formGui->getSaveCommand());
67 }
68
69 protected function testSaveAndNewCommand(): void
70 {
71 $expected = 'testCommand';
72
73 $this->formGui->setSaveAndNewCommand($expected);
74
75 $this->assertEquals($expected, $this->formGui->getSaveAndNewCommand());
76 }
77}
Class ilTestBaseClass.
setGlobalVariable(string $name, mixed $value)