Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 113... Línea 113...
113
        }
113
        }
Línea 114... Línea 114...
114
 
114
 
115
        return $newvar;
115
        return $newvar;
Línea 116... Línea 116...
116
    }
116
    }
117
 
117
 
118
    public function test_xml_escape_simple_input_not_escaped() {
118
    public function test_xml_escape_simple_input_not_escaped(): void {
119
        $exporter = new qformat_xml();
119
        $exporter = new qformat_xml();
120
        $string = 'Nothing funny here. Even if we go to a café or to 日本.';
120
        $string = 'Nothing funny here. Even if we go to a café or to 日本.';
Línea 121... Línea 121...
121
        $this->assertEquals($string, $exporter->xml_escape($string));
121
        $this->assertEquals($string, $exporter->xml_escape($string));
122
    }
122
    }
123
 
123
 
124
    public function test_xml_escape_html_wrapped_in_cdata() {
124
    public function test_xml_escape_html_wrapped_in_cdata(): void {
125
        $exporter = new qformat_xml();
125
        $exporter = new qformat_xml();
Línea 126... Línea 126...
126
        $string = '<p>Nothing <b>funny<b> here. Even if we go to a café or to 日本.</p>';
126
        $string = '<p>Nothing <b>funny<b> here. Even if we go to a café or to 日本.</p>';
127
        $this->assertEquals('<![CDATA[' . $string . ']]>', $exporter->xml_escape($string));
127
        $this->assertEquals('<![CDATA[' . $string . ']]>', $exporter->xml_escape($string));
128
    }
128
    }
129
 
129
 
130
    public function test_xml_escape_script_tag_handled_ok() {
130
    public function test_xml_escape_script_tag_handled_ok(): void {
Línea 131... Línea 131...
131
        $exporter = new qformat_xml();
131
        $exporter = new qformat_xml();
132
        $input = '<script><![CDATA[alert(1<2);]]></script>';
132
        $input = '<script><![CDATA[alert(1<2);]]></script>';
133
        $expected = '<![CDATA[<script><![CDATA[alert(1<2);]]]]><![CDATA[></script>]]>';
133
        $expected = '<![CDATA[<script><![CDATA[alert(1<2);]]]]><![CDATA[></script>]]>';
134
        $this->assertEquals($expected, $exporter->xml_escape($input));
134
        $this->assertEquals($expected, $exporter->xml_escape($input));
Línea 135... Línea 135...
135
 
135
 
136
        // Check that parsing the expected result does give the input again.
136
        // Check that parsing the expected result does give the input again.
137
        $parsed = simplexml_load_string('<div>' . $expected . '</div>');
137
        $parsed = simplexml_load_string('<div>' . $expected . '</div>');
138
        $this->assertEquals($input, $parsed->xpath('//div')[0]);
138
        $this->assertEquals($input, $parsed->xpath('//div')[0]);
139
    }
139
    }
Línea 140... Línea 140...
140
 
140
 
141
    public function test_xml_escape_code_that_looks_like_cdata_end_ok() {
141
    public function test_xml_escape_code_that_looks_like_cdata_end_ok(): void {
142
        $exporter = new qformat_xml();
142
        $exporter = new qformat_xml();
143
        $input = "if (x[[0]]>a) print('hah');";
143
        $input = "if (x[[0]]>a) print('hah');";
Línea 144... Línea 144...
144
        $expected = "<![CDATA[if (x[[0]]]]><![CDATA[>a) print('hah');]]>";
144
        $expected = "<![CDATA[if (x[[0]]]]><![CDATA[>a) print('hah');]]>";
145
        $this->assertEquals($expected, $exporter->xml_escape($input));
145
        $this->assertEquals($expected, $exporter->xml_escape($input));
146
 
146
 
147
        // Check that parsing the expected result does give the input again.
147
        // Check that parsing the expected result does give the input again.
148
        $parsed = simplexml_load_string('<div>' . $expected . '</div>');
148
        $parsed = simplexml_load_string('<div>' . $expected . '</div>');
149
        $this->assertEquals($input, $parsed->xpath('//div')[0]);
149
        $this->assertEquals($input, $parsed->xpath('//div')[0]);
Línea 177... Línea 177...
177
        $this->assertDoesNotMatchRegularExpression('|<shownumcorrect/>|', $xml);
177
        $this->assertDoesNotMatchRegularExpression('|<shownumcorrect/>|', $xml);
178
        $this->assertDoesNotMatchRegularExpression('|<clearwrong/>|', $xml);
178
        $this->assertDoesNotMatchRegularExpression('|<clearwrong/>|', $xml);
179
        $this->assertDoesNotMatchRegularExpression('|<options>|', $xml);
179
        $this->assertDoesNotMatchRegularExpression('|<options>|', $xml);
180
    }
180
    }
Línea 181... Línea 181...
181
 
181
 
182
    public function test_write_hint_with_parts() {
182
    public function test_write_hint_with_parts(): void {
183
        $q = $this->make_test_question();
183
        $q = $this->make_test_question();
184
        $q->contextid = \context_system::instance()->id;
184
        $q->contextid = \context_system::instance()->id;
185
        $q->name = 'Matching question';
185
        $q->name = 'Matching question';
186
        $q->questiontext = 'Classify the animals.';
186
        $q->questiontext = 'Classify the animals.';
Línea 217... Línea 217...
217
        $this->assertMatchesRegularExpression('|<shownumcorrect/>|', $hint2);
217
        $this->assertMatchesRegularExpression('|<shownumcorrect/>|', $hint2);
218
        $this->assertDoesNotMatchRegularExpression('|<clearwrong/>|', $hint2);
218
        $this->assertDoesNotMatchRegularExpression('|<clearwrong/>|', $hint2);
219
        $this->assertDoesNotMatchRegularExpression('|<options>|', $xml);
219
        $this->assertDoesNotMatchRegularExpression('|<options>|', $xml);
220
    }
220
    }
Línea 221... Línea 221...
221
 
221
 
222
    public function test_import_hints_no_parts() {
222
    public function test_import_hints_no_parts(): void {
223
        $xml = <<<END
223
        $xml = <<<END
224
<question>
224
<question>
225
    <hint>
225
    <hint>
226
        <text>This is the first hint</text>
226
        <text>This is the first hint</text>
Línea 247... Línea 247...
247
                ), $qo->hint);
247
                ), $qo->hint);
248
        $this->assertFalse(isset($qo->hintclearwrong));
248
        $this->assertFalse(isset($qo->hintclearwrong));
249
        $this->assertFalse(isset($qo->hintshownumcorrect));
249
        $this->assertFalse(isset($qo->hintshownumcorrect));
250
    }
250
    }
Línea 251... Línea 251...
251
 
251
 
252
    public function test_import_hints_with_parts() {
252
    public function test_import_hints_with_parts(): void {
253
        $xml = <<<END
253
        $xml = <<<END
254
<question>
254
<question>
255
    <hint>
255
    <hint>
256
        <text>This is the first hint</text>
256
        <text>This is the first hint</text>
Línea 277... Línea 277...
277
                ), $qo->hint);
277
                ), $qo->hint);
278
        $this->assertEquals(array(1, 0), $qo->hintclearwrong);
278
        $this->assertEquals(array(1, 0), $qo->hintclearwrong);
279
        $this->assertEquals(array(0, 1), $qo->hintshownumcorrect);
279
        $this->assertEquals(array(0, 1), $qo->hintshownumcorrect);
280
    }
280
    }
Línea 281... Línea 281...
281
 
281
 
282
    public function test_import_no_hints_no_error() {
282
    public function test_import_no_hints_no_error(): void {
283
        $xml = <<<END
283
        $xml = <<<END
284
<question>
284
<question>
285
</question>
285
</question>
Línea 292... Línea 292...
292
        $importer->import_hints($qo, $questionxml['question'], 'html');
292
        $importer->import_hints($qo, $questionxml['question'], 'html');
Línea 293... Línea 293...
293
 
293
 
294
        $this->assertFalse(isset($qo->hint));
294
        $this->assertFalse(isset($qo->hint));
Línea 295... Línea 295...
295
    }
295
    }
296
 
296
 
297
    public function test_import_description() {
297
    public function test_import_description(): void {
298
        $xml = '  <question type="description">
298
        $xml = '  <question type="description">
299
    <name>
299
    <name>
300
      <text>A description</text>
300
      <text>A description</text>
Línea 330... Línea 330...
330
        $expectedq->tags = array('tagDescription', 'tagTest');
330
        $expectedq->tags = array('tagDescription', 'tagTest');
Línea 331... Línea 331...
331
 
331
 
332
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
332
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 333... Línea 333...
333
    }
333
    }
334
 
334
 
335
    public function test_export_description() {
335
    public function test_export_description(): void {
336
        $qdata = new \stdClass();
336
        $qdata = new \stdClass();
337
        $qdata->id = 123;
337
        $qdata->id = 123;
338
        $qdata->contextid = \context_system::instance()->id;
338
        $qdata->contextid = \context_system::instance()->id;
Línea 370... Línea 370...
370
';
370
';
Línea 371... Línea 371...
371
 
371
 
372
        $this->assert_same_xml($expectedxml, $xml);
372
        $this->assert_same_xml($expectedxml, $xml);
Línea 373... Línea 373...
373
    }
373
    }
374
 
374
 
375
    public function test_import_essay_20() {
375
    public function test_import_essay_20(): void {
376
        $xml = '  <question type="essay">
376
        $xml = '  <question type="essay">
377
    <name>
377
    <name>
378
      <text>An essay</text>
378
      <text>An essay</text>
Línea 424... Línea 424...
424
        $expectedq->tags = array('tagEssay', 'tagEssay20', 'tagTest');
424
        $expectedq->tags = array('tagEssay', 'tagEssay20', 'tagTest');
Línea 425... Línea 425...
425
 
425
 
426
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
426
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 427... Línea 427...
427
    }
427
    }
428
 
428
 
429
    public function test_import_essay_21() {
429
    public function test_import_essay_21(): void {
430
        $xml = '  <question type="essay">
430
        $xml = '  <question type="essay">
431
    <name>
431
    <name>
432
      <text>An essay</text>
432
      <text>An essay</text>
Línea 489... Línea 489...
489
        $expectedq->tags = array('tagEssay', 'tagEssay21', 'tagTest');
489
        $expectedq->tags = array('tagEssay', 'tagEssay21', 'tagTest');
Línea 490... Línea 490...
490
 
490
 
491
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
491
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 492... Línea 492...
492
    }
492
    }
493
 
493
 
494
    public function test_import_essay_311() {
494
    public function test_import_essay_311(): void {
495
        $xml = '  <question type="essay">
495
        $xml = '  <question type="essay">
496
    <name>
496
    <name>
497
      <text>An essay</text>
497
      <text>An essay</text>
Línea 558... Línea 558...
558
        $expectedq->tags = array('tagEssay', 'tagEssay21', 'tagTest');
558
        $expectedq->tags = array('tagEssay', 'tagEssay21', 'tagTest');
Línea 559... Línea 559...
559
 
559
 
560
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
560
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 561... Línea 561...
561
    }
561
    }
562
 
562
 
563
    public function test_export_essay() {
563
    public function test_export_essay(): void {
564
        $qdata = new \stdClass();
564
        $qdata = new \stdClass();
565
        $qdata->id = 123;
565
        $qdata->id = 123;
566
        $qdata->contextid = \context_system::instance()->id;
566
        $qdata->contextid = \context_system::instance()->id;
Línea 628... Línea 628...
628
';
628
';
Línea 629... Línea 629...
629
 
629
 
630
        $this->assert_same_xml($expectedxml, $xml);
630
        $this->assert_same_xml($expectedxml, $xml);
Línea 631... Línea 631...
631
    }
631
    }
632
 
632
 
633
    public function test_import_match_19() {
633
    public function test_import_match_19(): void {
634
        $xml = '  <question type="matching">
634
        $xml = '  <question type="matching">
635
    <name>
635
    <name>
636
      <text>Matching question</text>
636
      <text>Matching question</text>
Línea 730... Línea 730...
730
        $expectedq->tags = array('tagMatching', 'tagTest');
730
        $expectedq->tags = array('tagMatching', 'tagTest');
Línea 731... Línea 731...
731
 
731
 
732
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
732
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 733... Línea 733...
733
    }
733
    }
734
 
734
 
735
    public function test_export_match() {
735
    public function test_export_match(): void {
736
        $qdata = new \stdClass();
736
        $qdata = new \stdClass();
737
        $qdata->id = 123;
737
        $qdata->id = 123;
738
        $qdata->contextid = \context_system::instance()->id;
738
        $qdata->contextid = \context_system::instance()->id;
Línea 855... Línea 855...
855
';
855
';
Línea 856... Línea 856...
856
 
856
 
857
        $this->assert_same_xml($expectedxml, $xml);
857
        $this->assert_same_xml($expectedxml, $xml);
Línea 858... Línea 858...
858
    }
858
    }
859
 
859
 
860
    public function test_import_multichoice_19() {
860
    public function test_import_multichoice_19(): void {
861
        $xml = '  <question type="multichoice">
861
        $xml = '  <question type="multichoice">
862
    <name>
862
    <name>
863
      <text>Multiple choice question</text>
863
      <text>Multiple choice question</text>
Línea 963... Línea 963...
963
        $expectedq->hintclearwrong = array(false, false);
963
        $expectedq->hintclearwrong = array(false, false);
Línea 964... Línea 964...
964
 
964
 
965
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
965
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 966... Línea 966...
966
    }
966
    }
967
 
967
 
968
    public function test_export_multichoice() {
968
    public function test_export_multichoice(): void {
969
        $qdata = new \stdClass();
969
        $qdata = new \stdClass();
970
        $qdata->id = 123;
970
        $qdata->id = 123;
971
        $qdata->contextid = \context_system::instance()->id;
971
        $qdata->contextid = \context_system::instance()->id;
Línea 1072... Línea 1072...
1072
';
1072
';
Línea 1073... Línea 1073...
1073
 
1073
 
1074
        $this->assert_same_xml($expectedxml, $xml);
1074
        $this->assert_same_xml($expectedxml, $xml);
Línea 1075... Línea 1075...
1075
    }
1075
    }
1076
 
1076
 
1077
    public function test_import_numerical_19() {
1077
    public function test_import_numerical_19(): void {
1078
        $xml = '  <question type="numerical">
1078
        $xml = '  <question type="numerical">
1079
    <name>
1079
    <name>
1080
      <text>Numerical question</text>
1080
      <text>Numerical question</text>
Línea 1138... Línea 1138...
1138
        $expectedq->tolerance = array(0.001, 1, '');
1138
        $expectedq->tolerance = array(0.001, 1, '');
Línea 1139... Línea 1139...
1139
 
1139
 
1140
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
1140
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 1141... Línea 1141...
1141
    }
1141
    }
1142
 
1142
 
Línea 1143... Línea 1143...
1143
    public function test_export_numerical() {
1143
    public function test_export_numerical(): void {
1144
        question_bank::load_question_definition_classes('numerical');
1144
        question_bank::load_question_definition_classes('numerical');
1145
 
1145
 
Línea 1213... Línea 1213...
1213
';
1213
';
Línea 1214... Línea 1214...
1214
 
1214
 
1215
        $this->assert_same_xml($expectedxml, $xml);
1215
        $this->assert_same_xml($expectedxml, $xml);
Línea 1216... Línea 1216...
1216
    }
1216
    }
1217
 
1217
 
1218
    public function test_import_shortanswer_19() {
1218
    public function test_import_shortanswer_19(): void {
1219
        $xml = '  <question type="shortanswer">
1219
        $xml = '  <question type="shortanswer">
1220
    <name>
1220
    <name>
1221
      <text>Short answer question</text>
1221
      <text>Short answer question</text>
Línea 1272... Línea 1272...
1272
            array('text' => 'Doh!', 'format' => FORMAT_HTML));
1272
            array('text' => 'Doh!', 'format' => FORMAT_HTML));
Línea 1273... Línea 1273...
1273
 
1273
 
1274
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
1274
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 1275... Línea 1275...
1275
    }
1275
    }
1276
 
1276
 
1277
    public function test_export_shortanswer() {
1277
    public function test_export_shortanswer(): void {
1278
        $qdata = new \stdClass();
1278
        $qdata = new \stdClass();
1279
        $qdata->id = 123;
1279
        $qdata->id = 123;
1280
        $qdata->contextid = \context_system::instance()->id;
1280
        $qdata->contextid = \context_system::instance()->id;
Línea 1344... Línea 1344...
1344
';
1344
';
Línea 1345... Línea 1345...
1345
 
1345
 
1346
        $this->assert_same_xml($expectedxml, $xml);
1346
        $this->assert_same_xml($expectedxml, $xml);
Línea 1347... Línea 1347...
1347
    }
1347
    }
1348
 
1348
 
1349
    public function test_import_truefalse_19() {
1349
    public function test_import_truefalse_19(): void {
1350
        $xml = '  <question type="truefalse">
1350
        $xml = '  <question type="truefalse">
1351
    <name>
1351
    <name>
1352
      <text>True false question</text>
1352
      <text>True false question</text>
Línea 1395... Línea 1395...
1395
        $expectedq->correctanswer = true;
1395
        $expectedq->correctanswer = true;
Línea 1396... Línea 1396...
1396
 
1396
 
1397
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
1397
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 1398... Línea 1398...
1398
    }
1398
    }
1399
 
1399
 
1400
    public function test_import_truefalse_with_idnumber() {
1400
    public function test_import_truefalse_with_idnumber(): void {
1401
        $xml = '  <question type="truefalse">
1401
        $xml = '  <question type="truefalse">
1402
    <name>
1402
    <name>
1403
      <text>True false question</text>
1403
      <text>True false question</text>
Línea 1448... Línea 1448...
1448
        $expectedq->correctanswer = true;
1448
        $expectedq->correctanswer = true;
Línea 1449... Línea 1449...
1449
 
1449
 
1450
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
1450
        $this->assert(new question_check_specified_fields_expectation($expectedq), $q);
Línea 1451... Línea 1451...
1451
    }
1451
    }
1452
 
1452
 
1453
    public function test_export_truefalse() {
1453
    public function test_export_truefalse(): void {
1454
        $qdata = new \stdClass();
1454
        $qdata = new \stdClass();
1455
        $qdata->id = 12;
1455
        $qdata->id = 12;
1456
        $qdata->contextid = \context_system::instance()->id;
1456
        $qdata->contextid = \context_system::instance()->id;
Línea 1508... Línea 1508...
1508
';
1508
';
Línea 1509... Línea 1509...
1509
 
1509
 
1510
        $this->assert_same_xml($expectedxml, $xml);
1510
        $this->assert_same_xml($expectedxml, $xml);
Línea 1511... Línea 1511...
1511
    }
1511
    }
1512
 
1512
 
1513
    public function test_export_truefalse_with_idnumber() {
1513
    public function test_export_truefalse_with_idnumber(): void {
1514
        $qdata = new \stdClass();
1514
        $qdata = new \stdClass();
1515
        $qdata->id = 12;
1515
        $qdata->id = 12;
1516
        $qdata->contextid = \context_system::instance()->id;
1516
        $qdata->contextid = \context_system::instance()->id;
Línea 1568... Línea 1568...
1568
';
1568
';
Línea 1569... Línea 1569...
1569
 
1569
 
1570
        $this->assert_same_xml($expectedxml, $xml);
1570
        $this->assert_same_xml($expectedxml, $xml);
Línea 1571... Línea 1571...
1571
    }
1571
    }
1572
 
1572
 
1573
    public function test_import_multianswer() {
1573
    public function test_import_multianswer(): void {
1574
        $xml = '  <question type="cloze">
1574
        $xml = '  <question type="cloze">
1575
    <name>
1575
    <name>
1576
      <text>Simple multianswer</text>
1576
      <text>Simple multianswer</text>
Línea 1677... Línea 1677...
1677
        $this->assertEquals($expectedqa->options->questions[1], $q->options->questions[1]);
1677
        $this->assertEquals($expectedqa->options->questions[1], $q->options->questions[1]);
1678
        $this->assertEquals($expectedqa->options->questions[2], $q->options->questions[2]);
1678
        $this->assertEquals($expectedqa->options->questions[2], $q->options->questions[2]);
1679
        $this->assert(new question_check_specified_fields_expectation($expectedqa), $q);
1679
        $this->assert(new question_check_specified_fields_expectation($expectedqa), $q);
1680
    }
1680
    }
Línea 1681... Línea 1681...
1681
 
1681
 
1682
    public function test_export_multianswer() {
1682
    public function test_export_multianswer(): void {
1683
        $qdata = \test_question_maker::get_question_data('multianswer', 'twosubq');
1683
        $qdata = \test_question_maker::get_question_data('multianswer', 'twosubq');
1684
        $qdata->contextid = \context_system::instance()->id;
1684
        $qdata->contextid = \context_system::instance()->id;
1685
        $exporter = new qformat_xml();
1685
        $exporter = new qformat_xml();
Línea 1709... Línea 1709...
1709
';
1709
';
Línea 1710... Línea 1710...
1710
 
1710
 
1711
        $this->assert_same_xml($expectedxml, $xml);
1711
        $this->assert_same_xml($expectedxml, $xml);
Línea 1712... Línea 1712...
1712
    }
1712
    }
1713
 
1713
 
1714
    public function test_export_multianswer_withdollars() {
1714
    public function test_export_multianswer_withdollars(): void {
1715
        $qdata = \test_question_maker::get_question_data('multianswer', 'dollarsigns');
1715
        $qdata = \test_question_maker::get_question_data('multianswer', 'dollarsigns');
1716
        $qdata->contextid = \context_system::instance()->id;
1716
        $qdata->contextid = \context_system::instance()->id;
Línea 1735... Línea 1735...
1735
';
1735
';
Línea 1736... Línea 1736...
1736
 
1736
 
1737
        $this->assert_same_xml($expectedxml, $xml);
1737
        $this->assert_same_xml($expectedxml, $xml);
Línea 1738... Línea 1738...
1738
    }
1738
    }
1739
 
1739
 
1740
    public function test_import_files_as_draft() {
1740
    public function test_import_files_as_draft(): void {
Línea 1741... Línea 1741...
1741
        $this->resetAfterTest();
1741
        $this->resetAfterTest();
1742
        $this->setAdminUser();
1742
        $this->setAdminUser();
Línea 1761... Línea 1761...
1761
        $this->assertEquals('moodle.txt', $file->filename);
1761
        $this->assertEquals('moodle.txt', $file->filename);
1762
        $this->assertEquals('/',          $file->filepath);
1762
        $this->assertEquals('/',          $file->filepath);
1763
        $this->assertEquals(6,            $file->size);
1763
        $this->assertEquals(6,            $file->size);
1764
    }
1764
    }
Línea 1765... Línea 1765...
1765
 
1765
 
1766
    public function test_import_truefalse_wih_files() {
1766
    public function test_import_truefalse_wih_files(): void {
1767
        $this->resetAfterTest();
1767
        $this->resetAfterTest();
Línea 1768... Línea 1768...
1768
        $this->setAdminUser();
1768
        $this->setAdminUser();
1769
 
1769
 
Línea 1808... Línea 1808...
1808
        $this->assertEquals('moodle.txt', $file->filename);
1808
        $this->assertEquals('moodle.txt', $file->filename);
1809
        $this->assertEquals('/myfolder/', $file->filepath);
1809
        $this->assertEquals('/myfolder/', $file->filepath);
1810
        $this->assertEquals(6,            $file->size);
1810
        $this->assertEquals(6,            $file->size);
1811
    }
1811
    }
Línea 1812... Línea 1812...
1812
 
1812
 
Línea 1813... Línea 1813...
1813
    public function test_create_dummy_question() {
1813
    public function test_create_dummy_question(): void {
1814
 
1814
 
1815
        $testobject = new mock_qformat_xml();
1815
        $testobject = new mock_qformat_xml();
1816
        $categoryname = 'name1';
1816
        $categoryname = 'name1';