ILIAS  release_8 Revision v8.24
ilTestRandomQuestionSetPoolDefinitionFormGUITest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21use PHPUnit\Framework\MockObject\MockObject;
22
28{
32 private $ctrl_mock;
36 private $lng_mock;
37
38 // ilTestRandomQuestionSetPoolDefinitionFormGUI
39 private $formGui;
40
41 protected function setUp(): void
42 {
43 parent::setUp();
44 $this->ctrl_mock = $this->createMock(ilCtrl::class);
45 $this->lng_mock = $this->createMock(ilLanguage::class);
46
47 $this->setGlobalVariable("lng", $this->lng_mock);
48 $this->setGlobalVariable("ilCtrl", $this->ctrl_mock);
49
50 $objTest_mock = $this->createMock(ilObjTest::class);
51 $testRandomQuestionSetConfigGUI_mock = $this->getMockBuilder(
52 ilTestRandomQuestionSetConfigGUI::class
53 )->disableOriginalConstructor()->getMock();
54
55 $testRandomQuestionSetConfig_mock = $this->getMockBuilder(
56 ilTestRandomQuestionSetConfig::class,
57 )->disableOriginalConstructor()->getMock();
58
60 $this->ctrl_mock,
61 $this->lng_mock,
62 $objTest_mock,
63 $testRandomQuestionSetConfigGUI_mock,
64 $testRandomQuestionSetConfig_mock
65 );
66 }
67
69 {
70 $this->assertInstanceOf(ilTestRandomQuestionSetPoolDefinitionFormGUI::class, $this->formGui);
71 }
72
73 protected function testSaveCommand(): void
74 {
75 $expected = "testCommand";
76
77 $this->formGui->setSaveCommand($expected);
78
79 $this->assertEquals($expected, $this->formGui->getSaveCommand());
80 }
81
82 protected function testSaveAndNewCommand(): void
83 {
84 $expected = "testCommand";
85
86 $this->formGui->setSaveAndNewCommand($expected);
87
88 $this->assertEquals($expected, $this->formGui->getSaveAndNewCommand());
89 }
90}
Class ilTestBaseClass.
setGlobalVariable(string $name, $value)