Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 84... Línea 84...
84
    }
84
    }
Línea 85... Línea 85...
85
 
85
 
86
    /**
86
    /**
87
     * Test loading data and returning preview content.
87
     * Test loading data and returning preview content.
88
     */
88
     */
89
    public function test_load_csv_content() {
89
    public function test_load_csv_content(): void {
90
        $encoding = 'utf8';
90
        $encoding = 'utf8';
91
        $separator = 'comma';
91
        $separator = 'comma';
92
        $previewrows = 5;
92
        $previewrows = 5;
93
        $csvpreview = new \phpunit_gradeimport_csv_load_data();
93
        $csvpreview = new \phpunit_gradeimport_csv_load_data();
Línea 144... Línea 144...
144
    }
144
    }
Línea 145... Línea 145...
145
 
145
 
146
    /**
146
    /**
147
     * Test fetching grade items for the course.
147
     * Test fetching grade items for the course.
148
     */
148
     */
Línea 149... Línea 149...
149
    public function test_fetch_grade_items() {
149
    public function test_fetch_grade_items(): void {
150
 
150
 
Línea 151... Línea 151...
151
        $gradeitemsarray = \grade_item::fetch_all(array('courseid' => $this->courseid));
151
        $gradeitemsarray = \grade_item::fetch_all(array('courseid' => $this->courseid));
Línea 172... Línea 172...
172
    }
172
    }
Línea 173... Línea 173...
173
 
173
 
174
    /**
174
    /**
175
     * Test the inserting of grade record data.
175
     * Test the inserting of grade record data.
176
     */
176
     */
177
    public function test_insert_grade_record() {
177
    public function test_insert_grade_record(): void {
Línea 178... Línea 178...
178
        global $DB, $USER;
178
        global $DB, $USER;
179
 
179
 
Línea 211... Línea 211...
211
    }
211
    }
Línea 212... Línea 212...
212
 
212
 
213
    /**
213
    /**
214
     * Test preparing a new grade item for import into the gradebook.
214
     * Test preparing a new grade item for import into the gradebook.
215
     */
215
     */
216
    public function test_import_new_grade_item() {
216
    public function test_import_new_grade_item(): void {
Línea 217... Línea 217...
217
        global $DB;
217
        global $DB;
218
 
218
 
219
        $this->setAdminUser();
219
        $this->setAdminUser();
Línea 286... Línea 286...
286
     * @param string $field The field to use for the query.
286
     * @param string $field The field to use for the query.
287
     * @param string|boolean $value The field value. When fetching by ID, set true to fetch valid user ID, false otherwise.
287
     * @param string|boolean $value The field value. When fetching by ID, set true to fetch valid user ID, false otherwise.
288
     * @param boolean $successexpected Whether we expect for a user to be found or not.
288
     * @param boolean $successexpected Whether we expect for a user to be found or not.
289
     * @param int $allowaccountssameemail Value for $CFG->allowaccountssameemail
289
     * @param int $allowaccountssameemail Value for $CFG->allowaccountssameemail
290
     */
290
     */
291
    public function test_check_user_exists($field, $value, $successexpected, $allowaccountssameemail = 0) {
291
    public function test_check_user_exists($field, $value, $successexpected, $allowaccountssameemail = 0): void {
292
        $this->resetAfterTest();
292
        $this->resetAfterTest();
Línea 293... Línea 293...
293
 
293
 
Línea 294... Línea 294...
294
        $generator = $this->getDataGenerator();
294
        $generator = $this->getDataGenerator();
Línea 356... Línea 356...
356
    }
356
    }
Línea 357... Línea 357...
357
 
357
 
358
    /**
358
    /**
359
     * Test preparing feedback for inserting / updating into the gradebook.
359
     * Test preparing feedback for inserting / updating into the gradebook.
360
     */
360
     */
Línea 361... Línea 361...
361
    public function test_create_feedback() {
361
    public function test_create_feedback(): void {
362
 
362
 
Línea 363... Línea 363...
363
        $testarray = $this->csv_load($this->oktext);
363
        $testarray = $this->csv_load($this->oktext);
Línea 372... Línea 372...
372
    }
372
    }
Línea 373... Línea 373...
373
 
373
 
374
    /**
374
    /**
375
     * Test preparing grade_items for upgrading into the gradebook.
375
     * Test preparing grade_items for upgrading into the gradebook.
376
     */
376
     */
Línea 377... Línea 377...
377
    public function test_update_grade_item() {
377
    public function test_update_grade_item(): void {
378
 
378
 
Línea 379... Línea 379...
379
        $testarray = $this->csv_load($this->oktext);
379
        $testarray = $this->csv_load($this->oktext);
Línea 405... Línea 405...
405
    }
405
    }
Línea 406... Línea 406...
406
 
406
 
407
    /**
407
    /**
408
     * Test importing data and mapping it with items in the course.
408
     * Test importing data and mapping it with items in the course.
409
     */
409
     */
410
    public function test_map_user_data_with_value() {
410
    public function test_map_user_data_with_value(): void {
411
        // Need to add one of the users into the system.
411
        // Need to add one of the users into the system.
412
        $user = new \stdClass();
412
        $user = new \stdClass();
413
        $user->firstname = 'Anne';
413
        $user->firstname = 'Anne';
414
        $user->lastname = 'Able';
414
        $user->lastname = 'Able';
Línea 458... Línea 458...
458
    }
458
    }
Línea 459... Línea 459...
459
 
459
 
460
    /**
460
    /**
461
     * Test importing data into the gradebook.
461
     * Test importing data into the gradebook.
462
     */
462
     */
463
    public function test_prepare_import_grade_data() {
463
    public function test_prepare_import_grade_data(): void {
Línea 464... Línea 464...
464
        global $DB;
464
        global $DB;
465
 
465
 
466
        // Need to add one of the users into the system.
466
        // Need to add one of the users into the system.
Línea 511... Línea 511...
511
    }
511
    }
Línea 512... Línea 512...
512
 
512
 
513
    /*
513
    /*
514
     * Test importing csv data into the gradebook using "Last downloaded from this course" column and force import option.
514
     * Test importing csv data into the gradebook using "Last downloaded from this course" column and force import option.
515
     */
515
     */
Línea 516... Línea 516...
516
    public function test_force_import_option() {
516
    public function test_force_import_option(): void {
517
 
517
 
518
        // Need to add users into the system.
518
        // Need to add users into the system.
519
        $user = new \stdClass();
519
        $user = new \stdClass();