Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

(no description)

File Size: 630 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: load_data_test  - 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