Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 72... Línea 72...
72
    }
72
    }
Línea 73... Línea 73...
73
 
73
 
74
    /**
74
    /**
75
     * test base_step class
75
     * test base_step class
76
     */
76
     */
Línea 77... Línea 77...
77
    function test_base_step() {
77
    function test_base_step(): void {
78
 
78
 
79
        $bp = new \mock_base_plan('planname'); // We need one plan
79
        $bp = new \mock_base_plan('planname'); // We need one plan
80
        $bt = new \mock_base_task('taskname', $bp); // We need one task
80
        $bt = new \mock_base_task('taskname', $bp); // We need one task
Línea 85... Línea 85...
85
    }
85
    }
Línea 86... Línea 86...
86
 
86
 
87
    /**
87
    /**
88
     * test backup_step class
88
     * test backup_step class
89
     */
89
     */
Línea 90... Línea 90...
90
    function test_backup_step() {
90
    function test_backup_step(): void {
91
 
91
 
92
        // We need one (non interactive) controller for instatiating plan
92
        // We need one (non interactive) controller for instatiating plan
93
        $bc = new backup_controller(backup::TYPE_1ACTIVITY, $this->moduleid, backup::FORMAT_MOODLE,
93
        $bc = new backup_controller(backup::TYPE_1ACTIVITY, $this->moduleid, backup::FORMAT_MOODLE,
Línea 105... Línea 105...
105
    }
105
    }
Línea 106... Línea 106...
106
 
106
 
107
    /**
107
    /**
108
     * test restore_step class, decrypt method
108
     * test restore_step class, decrypt method
109
     */
109
     */
Línea 110... Línea 110...
110
    public function test_restore_step_decrypt() {
110
    public function test_restore_step_decrypt(): void {
Línea 111... Línea 111...
111
 
111
 
112
        $this->resetAfterTest(true);
112
        $this->resetAfterTest(true);
Línea 151... Línea 151...
151
    }
151
    }
Línea 152... Línea 152...
152
 
152
 
153
    /**
153
    /**
154
     * test backup_structure_step class
154
     * test backup_structure_step class
155
     */
155
     */
156
    function test_backup_structure_step() {
156
    function test_backup_structure_step(): void {
Línea 157... Línea 157...
157
        global $CFG;
157
        global $CFG;
158
 
158
 
159
        $file = $CFG->tempdir . '/test/test_backup_structure_step.txt';
159
        $file = $CFG->tempdir . '/test/test_backup_structure_step.txt';
Línea 198... Línea 198...
198
 
198
 
199
 
199
 
200
    /**
200
    /**
201
     * Verify the add_plugin_structure() backup method behavior and created structures.
201
     * Verify the add_plugin_structure() backup method behavior and created structures.
202
     */
202
     */
203
    public function test_backup_structure_step_add_plugin_structure() {
203
    public function test_backup_structure_step_add_plugin_structure(): void {
204
        // Create mocked task, step and element.
204
        // Create mocked task, step and element.
205
        $bt = new \mock_backup_task_basepath('taskname');
205
        $bt = new \mock_backup_task_basepath('taskname');
206
        $bs = new \mock_backup_structure_step('steptest', null, $bt);
206
        $bs = new \mock_backup_structure_step('steptest', null, $bt);
Línea 225... Línea 225...
225
    }
225
    }
Línea 226... Línea 226...
226
 
226
 
227
    /**
227
    /**
228
     * Verify the add_subplugin_structure() backup method behavior and created structures.
228
     * Verify the add_subplugin_structure() backup method behavior and created structures.
229
     */
229
     */
230
    public function test_backup_structure_step_add_subplugin_structure() {
230
    public function test_backup_structure_step_add_subplugin_structure(): void {
231
        // Create mocked task, step and element.
231
        // Create mocked task, step and element.
232
        $bt = new \mock_backup_task_basepath('taskname');
232
        $bt = new \mock_backup_task_basepath('taskname');
233
        $bs = new \mock_backup_structure_step('steptest', null, $bt);
233
        $bs = new \mock_backup_structure_step('steptest', null, $bt);
234
        $el = new backup_nested_element('workshop', array('id'), array('one', 'two', 'qtype'));
234
        $el = new backup_nested_element('workshop', array('id'), array('one', 'two', 'qtype'));
Línea 308... Línea 308...
308
    }
308
    }
Línea 309... Línea 309...
309
 
309
 
310
    /**
310
    /**
311
     * Verify the add_plugin_structure() restore method behavior and created structures.
311
     * Verify the add_plugin_structure() restore method behavior and created structures.
312
     */
312
     */
313
    public function test_restore_structure_step_add_plugin_structure() {
313
    public function test_restore_structure_step_add_plugin_structure(): void {
314
        // Create mocked task, step and element.
314
        // Create mocked task, step and element.
315
        $bt = new \mock_restore_task_basepath('taskname');
315
        $bt = new \mock_restore_task_basepath('taskname');
316
        $bs = new \mock_restore_structure_step('steptest', null, $bt);
316
        $bs = new \mock_restore_structure_step('steptest', null, $bt);
317
        $el = new restore_path_element('question', '/some/path/to/question');
317
        $el = new restore_path_element('question', '/some/path/to/question');
Línea 346... Línea 346...
346
    }
346
    }
Línea 347... Línea 347...
347
 
347
 
348
    /**
348
    /**
349
     * Verify the add_subplugin_structure() restore method behavior and created structures.
349
     * Verify the add_subplugin_structure() restore method behavior and created structures.
350
     */
350
     */
351
    public function test_restore_structure_step_add_subplugin_structure() {
351
    public function test_restore_structure_step_add_subplugin_structure(): void {
352
        // Create mocked task, step and element.
352
        // Create mocked task, step and element.
353
        $bt = new \mock_restore_task_basepath('taskname');
353
        $bt = new \mock_restore_task_basepath('taskname');
354
        $bs = new \mock_restore_structure_step('steptest', null, $bt);
354
        $bs = new \mock_restore_structure_step('steptest', null, $bt);
355
        $el = new restore_path_element('workshop', '/path/to/workshop');
355
        $el = new restore_path_element('workshop', '/path/to/workshop');
Línea 452... Línea 452...
452
    }
452
    }
Línea 453... Línea 453...
453
 
453
 
454
    /**
454
    /**
455
     * wrong base_step class tests
455
     * wrong base_step class tests
456
     */
456
     */
Línea 457... Línea 457...
457
    function test_base_step_wrong() {
457
    function test_base_step_wrong(): void {
458
 
458
 
459
        // Try to pass one wrong task
459
        // Try to pass one wrong task
460
        try {
460
        try {
Línea 467... Línea 467...
467
    }
467
    }
Línea 468... Línea 468...
468
 
468
 
469
    /**
469
    /**
470
     * wrong backup_step class tests
470
     * wrong backup_step class tests
471
     */
471
     */
Línea 472... Línea 472...
472
    function test_backup_test_wrong() {
472
    function test_backup_test_wrong(): void {
473
 
473
 
474
        // Try to pass one wrong task
474
        // Try to pass one wrong task
475
        try {
475
        try {