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.

Class: profilelib_test  - X-Ref

Unit tests for user/profile/lib.php.

test_get_custom_fields()   X-Ref
Tests profile_get_custom_fields function and checks it is consistent
with profile_user_record.


test_default_constructor()   X-Ref
Make sure that all profile fields can be initialised without arguments.


test_profile_view()   X-Ref
Test profile_view function


test_profile_has_required_custom_fields_set()   X-Ref
Test that {@link user_not_fully_set_up()} takes required custom fields into account.


test_profile_fields_in_generator()   X-Ref
Test that user generator sets the custom profile fields


test_profile_get_custom_field_data_by_shortname_normal()   X-Ref
Tests the profile_get_custom_field_data_by_shortname function when working normally.


test_profile_get_custom_field_data_by_shortname_missing()   X-Ref
Tests the profile_get_custom_field_data_by_shortname function with a field that doesn't exist.


profile_get_custom_field_data_by_shortname_case_sensitivity_provider()   X-Ref
Data provider for {@see test_profile_get_custom_field_data_by_shortname_case_sensitivity}

return: array[]

test_profile_get_custom_field_data_by_shortname_case_sensitivity(string $shortname,string $shortnamesearch,bool $casesensitive,bool $expectmatch)   X-Ref
Test retrieving custom field by shortname, specifying case-sensitivity when matching

param: string $shortname
param: string $shortnamesearch
param: bool $casesensitive
param: bool $expectmatch