Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: myprofilelib_test  - X-Ref

Tests for myprofilelib apis.

setUp()   X-Ref


test_core_myprofile_navigation_as_admin()   X-Ref
Tests the core_myprofile_navigation() function as an admin viewing a user's course profile.


test_core_myprofile_navigation_course_without_permission()   X-Ref
Tests the core_myprofile_navigation() function as a user without permission to view the full
profile of another another user.


test_core_myprofile_navigation_profile_link_as_current_user()   X-Ref
Tests the core_myprofile_navigation() function as the currently logged in user.


test_core_myprofile_navigation_profile_link_as_admin()   X-Ref
Tests the core_myprofile_navigation() function as the admin viewing another user.


test_core_myprofile_navigation_preference_as_admin()   X-Ref
Tests the core_myprofile_navigation() function when viewing the preference page as an admin.


test_core_myprofile_navigation_preference_without_permission()   X-Ref
Tests the core_myprofile_navigation() function when viewing the preference
page as another user without the ability to use the 'loginas' functionality.


test_core_myprofile_navigation_contact_fields_as_admin()   X-Ref
Tests the core_myprofile_navigation() function as an admin viewing another user's contact details.


test_core_myprofile_navigation_contact_field_without_permission()   X-Ref
Tests the core_myprofile_navigation() function as a user viewing another user's profile
ensuring that the contact details are not shown.


core_myprofile_navigation_contact_timezone_provider()   X-Ref
Data provider for {@see test_core_myprofile_navigation_contact_timezone}

return: array[]

test_core_myprofile_navigation_contact_timezone(string $hiddenuserfields, string $forcetimezone,string $usertimezone, ?string $expectresult = null)   X-Ref
Test timezone node added to user profile navigation

param: string $hiddenuserfields
param: string $forcetimezone Timezone identifier or '99' (User can choose their own)
param: string $usertimezone Timezone identifier or '99' (Use server default)
param: string|null $expectresult
return: bool

test_core_myprofile_navigation_login_activity()   X-Ref
Tests the core_myprofile_navigation() function as an admin viewing another user's
profile ensuring the login activity links are shown.


test_core_myprofile_navigationn_login_activity_without_permission()   X-Ref
Tests the core_myprofile_navigation() function as a user viewing another user's profile
ensuring the login activity links are not shown.