Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Unit tests for the class in load_data.php

Copyright: 2014 Adrian Greeve
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 637 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: gradeimport_csv_load_data_testcase  - X-Ref

Unit tests for lib.php

tearDown()   X-Ref
No description

csv_load($content)   X-Ref
Load up the above text through the csv import.

param: string $content Text to be imported into the gradebook.
return: array All text separated by commas now in an array.

test_load_csv_content()   X-Ref
Test loading data and returning preview content.


test_fetch_grade_items()   X-Ref
Test fetching grade items for the course.


test_insert_grade_record()   X-Ref
Test the inserting of grade record data.


test_import_new_grade_item()   X-Ref
Test preparing a new grade item for import into the gradebook.


check_user_exists_provider()   X-Ref
Data provider for \gradeimport_csv_load_data_testcase::test_check_user_exists().

return: array

test_check_user_exists($field, $value, $successexpected, $allowaccountssameemail = 0)   X-Ref
Check that the user matches a user in the system.

param: string $field The field to use for the query.
param: string|boolean $value The field value. When fetching by ID, set true to fetch valid user ID, false otherwise.
param: boolean $successexpected Whether we expect for a user to be found or not.
param: int $allowaccountssameemail Value for $CFG->allowaccountssameemail

test_create_feedback()   X-Ref
Test preparing feedback for inserting / updating into the gradebook.


test_update_grade_item()   X-Ref
Test preparing grade_items for upgrading into the gradebook.


test_map_user_data_with_value()   X-Ref
Test importing data and mapping it with items in the course.


test_prepare_import_grade_data()   X-Ref
Test importing data into the gradebook.


test_force_import_option()   X-Ref
No description