Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Class: externallib_test  - X-Ref

Enrol external PHPunit tests

get_enrolled_users_visibility_provider()   X-Ref
dataProvider for test_get_enrolled_users_visibility().


test_get_enrolled_users_visibility($settings, $results)   X-Ref
Verify get_enrolled_users() returned users are the expected in every situation.


test_get_enrolled_users_active_suspended()   X-Ref
Verify get_enrolled_users() returned users according to their status.


test_get_users_courses()   X-Ref
Test get_users_courses


test_get_users_courses_can_view_participants()   X-Ref
Test that get_users_courses respects the capability to view participants when viewing courses of other user


test_get_users_courses_can_view_profile()   X-Ref
No description

test_get_users_courses_with_mathjax()   X-Ref
Test get_users_courses with mathjax in the name.


test_get_course_enrolment_methods()   X-Ref
Test get_course_enrolment_methods


get_enrolled_users_setup($capability)   X-Ref
No description

test_get_enrolled_users_without_parameters()   X-Ref
Test get_enrolled_users from core_enrol_external without additional
parameters.


test_get_enrolled_users_with_parameters()   X-Ref
Test get_enrolled_users from core_enrol_external with some parameters set.


test_get_enrolled_users_including_lastcourseaccess()   X-Ref
Test get_enrolled_users last course access.


test_get_enrolled_users_without_capability()   X-Ref
Test get_enrolled_users from core_enrol_external with capability to
viewparticipants removed.


get_enrolled_users_with_capability_setup($capability)   X-Ref
No description

test_get_enrolled_users_with_capability_without_parameters()   X-Ref
Test get_enrolled_users_with_capability without additional paramaters.


test_get_enrolled_users_with_capability_with_parameters()   X-Ref
Test get_enrolled_users_with_capability


test_get_enrolled_users_with_capability_including_lastcourseaccess()   X-Ref
Test get_enrolled_users last course access.


submit_user_enrolment_form_provider()   X-Ref
dataProvider for test_submit_user_enrolment_form().


test_submit_user_enrolment_form($customdata, $expectedresult, $validationerror)   X-Ref

param: array $customdata The data we are providing to the webservice.
param: bool $expectedresult The result we are expecting to receive from the webservice.
param: bool $validationerror The validationerror we are expecting to receive from the webservice.

test_unenerol_user_enrolment()   X-Ref
Test for core_enrol_external::unenrol_user_enrolment().


test_search_users()   X-Ref
Test for core_enrol_external::test_search_users().


test_get_potential_users()   X-Ref
Tests the get_potential_users external function (not too much detail because the back-end
is covered in another test).


extract_user_from_result(array $result, int $userid)   X-Ref
Utility function to get one user out of the get_potential_users result.

param: array $result Result array
param: int $userid User id
return: array Data for that user