16
16
17
17
namespace qtype_varnumericset ;
18
18
19
- /**
20
- * Unit tests for the varnumericset question edit form.
21
- *
22
- * @package qtype_varnumericset
23
- * @copyright 2023 The Open University
24
- * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
- */
26
-
27
19
defined ('MOODLE_INTERNAL ' ) || die ();
28
20
global $ CFG ;
29
21
33
25
/**
34
26
* Unit tests for the qtype_varnumericset question edit form.
35
27
*
28
+ * @package qtype_varnumericset
36
29
* @copyright 2023 The Open University
37
30
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
38
31
* @covers \qtype_varnumeric_edit_form_base
@@ -104,7 +97,7 @@ public function test_form_validation(array $fromform, array $expectederrors): vo
104
97
*
105
98
* @return array List of data sets (test cases).
106
99
*/
107
- public function form_validation_testcases (): array {
100
+ public static function form_validation_testcases (): array {
108
101
return [
109
102
'All OK ' => [
110
103
[
@@ -145,20 +138,20 @@ public function form_validation_testcases(): array {
145
138
],
146
139
[
147
140
'questiontext ' => get_string ('errorvalidationformatnumber ' , 'qtype_varnumericset ' ,
148
- '[[x.e]] - Expression evaluation error: an unexpected error occurred. ' ),
141
+ '[[x.e]] - Expression evaluation error: an unexpected error occurred. ' ),
149
142
'generalfeedback ' => get_string ('errorvalidationformatnumber ' , 'qtype_varnumericset ' ,
150
- '[[x.e]] - Expression evaluation error: an unexpected error occurred. ' ),
143
+ '[[x.e]] - Expression evaluation error: an unexpected error occurred. ' ),
151
144
'feedback[0] ' => get_string ('errorvalidationformatnumber ' , 'qtype_varnumericset ' ,
152
- "[[x, .e]] - The format specifier must not contain non-breaking space characters. " ),
145
+ "[[x, .e]] - The format specifier must not contain non-breaking space characters. " ),
153
146
'feedback[1] ' => get_string ('errorvalidationformatnumber ' , 'qtype_varnumericset ' ,
154
- '[[x,]] - Missing format specifier at end of string. ' ),
147
+ '[[x,]] - Missing format specifier at end of string. ' ),
155
148
'hint[0] ' => get_string ('errorvalidationformatnumber ' , 'qtype_varnumericset ' ,
156
- '[[x,i]] - Unknown format specifier "i". ' ),
149
+ '[[x,i]] - Unknown format specifier "i". ' ),
157
150
'hint[1] ' => get_string ('errorvalidationformatnumber ' , 'qtype_varnumericset ' ,
158
- '[[x,.3 \'.09 f]] - Unknown format specifier "'". ' ),
151
+ '[[x,.3 \'.09 f]] - Unknown format specifier "'". ' ),
159
152
'hint[2] ' => get_string ('errorvalidationformatnumber ' , 'qtype_varnumericset ' ,
160
- "<ul> \n<li>[[x,]] - Missing format specifier at end of string.</li> \n" .
161
- "<li>[[x,i]] - Unknown format specifier "i".</li> \n</ul> " ),
153
+ "<ul> \n<li>[[x,]] - Missing format specifier at end of string.</li> \n" .
154
+ "<li>[[x,i]] - Unknown format specifier "i".</li> \n</ul> " ),
162
155
],
163
156
],
164
157
[
@@ -172,9 +165,9 @@ public function form_validation_testcases(): array {
172
165
'variant1 ' => [],
173
166
],
174
167
[
175
- 'vartype[0] ' => 'At least one of the variables must be a predefined variable. '
176
- ]
177
- ]
168
+ 'vartype[0] ' => 'At least one of the variables must be a predefined variable. ' ,
169
+ ],
170
+ ],
178
171
];
179
172
}
180
173
}
0 commit comments