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: userlib_test  - X-Ref

Unit tests for user lib api.

test_user_get_user_details_courses()   X-Ref
Test user_get_user_details_courses


test_user_get_user_details_courses_groupmode_nogroups()   X-Ref
Verify return when course groupmode set to 'no groups'.


test_user_get_user_details_courses_groupmode_separate()   X-Ref
Verify return when course groupmode set to 'separate groups'.


test_user_get_user_details_courses_groupmode_visible()   X-Ref
Verify return when course groupmode set to 'visible groups'.


test_user_update_user()   X-Ref
Test user_update_user.


test_create_users()   X-Ref
Test create_users.


test_user_create_user_default_values()   X-Ref
Test that creating users populates default values


test_create_user_invalid_username($username, $expectmessage)   X-Ref
Test that {@link user_create_user()} throws exception when invalid username is provided.

param: string $username Invalid username
param: string $expectmessage Expected exception message

data_create_user_invalid_username()   X-Ref
Data provider for {@link self::test_create_user_invalid_username()}.

return: array

test_user_count_login_failures()   X-Ref
Test function user_count_login_failures().


test_user_add_password_history()   X-Ref
Test function user_add_password_history().


test_user_is_previously_used_password()   X-Ref
Test function user_add_password_history().


test_delete_of_hashes_on_user_delete()   X-Ref
Test that password history is deleted together with user.


test_user_list_view()   X-Ref
Test user_list_view function


test_user_menu_custom_avatar_size()   X-Ref
Test setting the user menu avatar size.


test_user_can_view_profile()   X-Ref
Test user_can_view_profile


test_user_get_user_details()   X-Ref
Test user_get_user_details


test_user_get_user_details_missing_fields()   X-Ref
Regression test for MDL-57840.

Ensure the fields "auth, confirmed, idnumber, lang, theme, timezone and mailformat" are present when
calling user_get_user_details() function.