Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 51... Línea 51...
51
class parser_test extends \advanced_testcase {
51
class parser_test extends \advanced_testcase {
Línea 52... Línea 52...
52
 
52
 
53
    /*
53
    /*
54
     * test progressive_parser public methods
54
     * test progressive_parser public methods
55
     */
55
     */
56
    function test_parser_public_api() {
56
    function test_parser_public_api(): void {
57
        global $CFG;
57
        global $CFG;
58
        // Instantiate progressive_parser
58
        // Instantiate progressive_parser
59
        $pp = new progressive_parser();
59
        $pp = new progressive_parser();
60
        $this->assertTrue($pp instanceof progressive_parser);
60
        $this->assertTrue($pp instanceof progressive_parser);
Línea 166... Línea 166...
166
 
166
 
167
    /*
167
    /*
168
     * test progressive_parser parsing results using testing_parser_processor and test1.xml
168
     * test progressive_parser parsing results using testing_parser_processor and test1.xml
169
     * auto-described file from fixtures
169
     * auto-described file from fixtures
170
     */
170
     */
171
    function test_parser_results() {
171
    function test_parser_results(): void {
172
        global $CFG;
172
        global $CFG;
173
        // Instantiate progressive_parser
173
        // Instantiate progressive_parser
174
        $pp = new progressive_parser();
174
        $pp = new progressive_parser();
175
        // Instantiate processor, passing the unit test as param
175
        // Instantiate processor, passing the unit test as param
Línea 191... Línea 191...
191
 
191
 
192
    /*
192
    /*
193
     * test progressive_parser parsing results using simplified_parser_processor and test4.xml
193
     * test progressive_parser parsing results using simplified_parser_processor and test4.xml
194
     * (one simple glossary backup file example)
194
     * (one simple glossary backup file example)
195
     */
195
     */
196
    function test_simplified_parser_results() {
196
    function test_simplified_parser_results(): void {
197
        global $CFG;
197
        global $CFG;
198
        // Instantiate progressive_parser
198
        // Instantiate progressive_parser
199
        $pp =  new progressive_parser();
199
        $pp =  new progressive_parser();
200
        // Instantiate simplified_parser_processor declaring the interesting paths
200
        // Instantiate simplified_parser_processor declaring the interesting paths
Línea 351... Línea 351...
351
    /**
351
    /**
352
     * test how the simplified processor and the order of start/process/end events happens
352
     * test how the simplified processor and the order of start/process/end events happens
353
     * with one real fragment of one backup 1.9 file, where some problems
353
     * with one real fragment of one backup 1.9 file, where some problems
354
     * were found by David, hence we honor him in the name of the test ;-)
354
     * were found by David, hence we honor him in the name of the test ;-)
355
     */
355
     */
356
    function test_simplified_david_backup19_file_fragment() {
356
    function test_simplified_david_backup19_file_fragment(): void {
357
        global $CFG;
357
        global $CFG;
358
        // Instantiate progressive_parser
358
        // Instantiate progressive_parser
359
        $pp =  new progressive_parser();
359
        $pp =  new progressive_parser();
360
        // Instantiate grouped_parser_processor
360
        // Instantiate grouped_parser_processor
361
        $pr = new mock_simplified_parser_processor();
361
        $pr = new mock_simplified_parser_processor();
Línea 417... Línea 417...
417
 
417
 
418
    /*
418
    /*
419
     * test progressive_parser parsing results using grouped_parser_processor and test4.xml
419
     * test progressive_parser parsing results using grouped_parser_processor and test4.xml
420
     * (one simple glossary backup file example)
420
     * (one simple glossary backup file example)
421
     */
421
     */
422
    function test_grouped_parser_results() {
422
    function test_grouped_parser_results(): void {
423
        global $CFG;
423
        global $CFG;
424
        // Instantiate progressive_parser
424
        // Instantiate progressive_parser
425
        $pp =  new progressive_parser();
425
        $pp =  new progressive_parser();
426
        // Instantiate grouped_parser_processor
426
        // Instantiate grouped_parser_processor
Línea 593... Línea 593...
593
    /**
593
    /**
594
     * test how the grouped processor and the order of start/process/end events happens
594
     * test how the grouped processor and the order of start/process/end events happens
595
     * with one real fragment of one backup 1.9 file, where some problems
595
     * with one real fragment of one backup 1.9 file, where some problems
596
     * were found by David, hence we honor him in the name of the test ;-)
596
     * were found by David, hence we honor him in the name of the test ;-)
597
     */
597
     */
598
    function test_grouped_david_backup19_file_fragment() {
598
    function test_grouped_david_backup19_file_fragment(): void {
599
        global $CFG;
599
        global $CFG;
600
        // Instantiate progressive_parser
600
        // Instantiate progressive_parser
601
        $pp =  new progressive_parser();
601
        $pp =  new progressive_parser();
602
        // Instantiate grouped_parser_processor
602
        // Instantiate grouped_parser_processor
603
        $pr = new mock_grouped_parser_processor();
603
        $pr = new mock_grouped_parser_processor();
Línea 647... Línea 647...
647
        $this->assertEquals($errcount, 0); // No errors found, plz
647
        $this->assertEquals($errcount, 0); // No errors found, plz
648
    }
648
    }
Línea 649... Línea 649...
649
 
649
 
650
    /**
650
    /**
651
     */
651
     */
652
    function test_grouped_at_empty_node() {
652
    function test_grouped_at_empty_node(): void {
653
        global $CFG;
653
        global $CFG;
654
        // Instantiate progressive_parser.
654
        // Instantiate progressive_parser.
655
        $pp =  new progressive_parser();
655
        $pp =  new progressive_parser();
656
        // Instantiate grouped_parser_processor.
656
        // Instantiate grouped_parser_processor.