This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Unit tests
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
\
Definition at line 26 of file assClozeTestTest.php.
◆ setUp()
assClozeTestTest::setUp |
( |
| ) |
|
|
protected |
Reimplemented from assBaseTestCase.
Definition at line 30 of file assClozeTestTest.php.
30 : void
31 {
32 parent::setUp();
33
34 $ilCtrl_mock = $this->getMockBuilder(ilCtrl::class)
35 ->disableOriginalConstructor()
36 ->getMock();
37 $ilCtrl_mock->method('saveParameter');
38 $ilCtrl_mock->method('saveParameterByClass');
40
41 $lng_mock = $this->getMockBuilder(ilLanguage::class)
42 ->disableOriginalConstructor()
43 ->onlyMethods(['txt'])
44 ->getMock();
45 $lng_mock->method('txt')->willReturn('Test');
47
50 }
setGlobalVariable(string $name, mixed $value)
References getDatabaseMock(), getIliasMock(), and setGlobalVariable().
◆ test_cleanQuestionText_shouldReturnCleanedText()
assClozeTestTest::test_cleanQuestionText_shouldReturnCleanedText |
( |
| ) |
|
Definition at line 59 of file assClozeTestTest.php.
59 : void
60 {
62 $in_text = 'Ein <gap>Männlein</gap> steht <gap id="Walter">im</gap> <b>Walde</b> ganz <gap 2>still</gap> und [gap]stumm[/gap]<hr />';
63 $expected = 'Ein [gap]Männlein[/gap] steht [gap]im[/gap] <b>Walde</b> ganz [gap]still[/gap] und [gap]stumm[/gap]<hr />';
64
65 $actual = $instance->cleanQuestiontext($in_text);
66
67 $this->assertEquals($expected, $actual);
68 }
◆ test_getAdditionalTableName_shouldReturnAdditionalTableName()
assClozeTestTest::test_getAdditionalTableName_shouldReturnAdditionalTableName |
( |
| ) |
|
Definition at line 155 of file assClozeTestTest.php.
155 : void
156 {
158 $expected = 'qpl_qst_cloze';
159
160 $actual = $instance->getAdditionalTableName();
161
162 $this->assertEquals($expected, $actual);
163 }
◆ test_getAnswerTableName_shouldReturnAnswerTableName()
assClozeTestTest::test_getAnswerTableName_shouldReturnAnswerTableName |
( |
| ) |
|
Definition at line 165 of file assClozeTestTest.php.
165 : void
166 {
168 $expected = ["qpl_a_cloze",'qpl_a_cloze_combi_res'];
169
170 $actual = $instance->getAnswerTableName();
171
172 $this->assertEquals($expected, $actual);
173 }
◆ test_getQuestionType_shouldReturnQuestionType()
assClozeTestTest::test_getQuestionType_shouldReturnQuestionType |
( |
| ) |
|
Definition at line 134 of file assClozeTestTest.php.
134 : void
135 {
137 $expected = 'assClozeTest';
138
139 $actual = $instance->getQuestionType();
140
141 $this->assertEquals($expected, $actual);
142 }
◆ test_instantiateObject_shouldReturnInstance()
assClozeTestTest::test_instantiateObject_shouldReturnInstance |
( |
| ) |
|
Definition at line 52 of file assClozeTestTest.php.
52 : void
53 {
55
56 $this->assertInstanceOf(assClozeTest::class, $instance);
57 }
◆ test_isComplete_shouldReturnFalseIfIncomplete()
assClozeTestTest::test_isComplete_shouldReturnFalseIfIncomplete |
( |
| ) |
|
Definition at line 70 of file assClozeTestTest.php.
70 : void
71 {
73 $expected = false;
74
75 $actual = $instance->isComplete();
76
77 $this->assertEquals($expected, $actual);
78 }
◆ test_setGetEndTag_defaultShoulBeApplied()
assClozeTestTest::test_setGetEndTag_defaultShoulBeApplied |
( |
| ) |
|
Definition at line 118 of file assClozeTestTest.php.
118 : void
119 {
121 $alternate_tag = '</gappo_the_great>';
122 $expected = '[/gap]';
123
124 $instance->setEndTag($alternate_tag);
125 $intermediate = $instance->getEndTag();
126 $this->assertEquals($alternate_tag, $intermediate);
127
128 $instance->setEndTag();
129 $actual = $instance->getEndTag();
130
131 $this->assertEquals($expected, $actual);
132 }
◆ test_setGetEndTag_shouldReturnValueUnchanged()
assClozeTestTest::test_setGetEndTag_shouldReturnValueUnchanged |
( |
| ) |
|
Definition at line 107 of file assClozeTestTest.php.
107 : void
108 {
110 $expected = '</gappo_the_great>';
111
112 $instance->setEndTag($expected);
113 $actual = $instance->getEndTag();
114
115 $this->assertEquals($expected, $actual);
116 }
◆ test_setGetFixedTextLength_shouldReturnValueUnchanged()
assClozeTestTest::test_setGetFixedTextLength_shouldReturnValueUnchanged |
( |
| ) |
|
Definition at line 175 of file assClozeTestTest.php.
175 : void
176 {
178 $expected = 123;
179
180 $instance->setFixedTextLength($expected);
181 $actual = $instance->getFixedTextLength();
182
183 $this->assertEquals($expected, $actual);
184 }
◆ test_setGetIdenticalScoring_shouldReturnValueUnchanged()
assClozeTestTest::test_setGetIdenticalScoring_shouldReturnValueUnchanged |
( |
| ) |
|
Definition at line 144 of file assClozeTestTest.php.
144 : void
145 {
147 $expected = 1;
148
149 $instance->setIdenticalScoring(true);
150 $actual = $instance->getIdenticalScoring();
151
152 $this->assertEquals($expected, $actual);
153 }
◆ test_setGetStartTag_defaultShoulBeApplied()
assClozeTestTest::test_setGetStartTag_defaultShoulBeApplied |
( |
| ) |
|
Definition at line 91 of file assClozeTestTest.php.
91 : void
92 {
94 $alternate_tag = '<gappo_the_great>';
95 $expected = '[gap]';
96
97 $instance->setStartTag($alternate_tag);
98 $intermediate = $instance->getStartTag();
99 $this->assertEquals($alternate_tag, $intermediate);
100
101 $instance->setStartTag();
102 $actual = $instance->getStartTag();
103
104 $this->assertEquals($expected, $actual);
105 }
◆ test_setGetStartTag_shouldReturnValueUnchanged()
assClozeTestTest::test_setGetStartTag_shouldReturnValueUnchanged |
( |
| ) |
|
Definition at line 80 of file assClozeTestTest.php.
80 : void
81 {
83 $expected = '<gappo_the_great>';
84
85 $instance->setStartTag($expected);
86 $actual = $instance->getStartTag();
87
88 $this->assertEquals($expected, $actual);
89 }
◆ $backupGlobals
assClozeTestTest::$backupGlobals = false |
|
protected |
The documentation for this class was generated from the following file: