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

Privacy manager unit tests.

tearDown()   X-Ref
Test tearDown.


get_mock_manager_with_core_components($componentnames)   X-Ref
Helper to spoof the results of the internal function get_components_list, allowing mock components to be tested.

param: array $componentnames and array of component names to include as valid core components.
return: PHPUnit_Framework_MockObject_MockObject

test_get_metadata_for_components()   X-Ref
Test collection of metadata for components implementing a metadata provider.


test_get_contexts_for_userid()   X-Ref
Test that get_contexts_for_userid() only returns contextlist collections for core providers.


test_component_is_compliant()   X-Ref
Test verifying the output of component_is_compliant.


component_is_compliant_provider()   X-Ref
Provider for component_is_compliant tests.

return: array

test_component_is_compliant_examples($component, $expected)   X-Ref
Test verifying the output of component_is_compliant with specified
components.

param: string  $component
param: boolean $expected

test_export_user_data()   X-Ref
Test verifying only approved contextlists can be used with the export_user_data method.


test_delete_data_for_user()   X-Ref
Test verifying only approved contextlists can be used with the delete_data_for_user method.


test_installed_plugins()   X-Ref
Ensure that all installed plugins can provide metadata.

This really just checks that all providers can be safely autoloaded.


test_get_null_provider_reason()   X-Ref
Test that the reason for the null provider is returned.


test_plugintype_class_callback()   X-Ref
Test that manager::plugintype_class_callback() can be executed.


test_component_class_callback()   X-Ref
Test that manager::component_class_callback() can be executed.


test_is_empty_subsystem($component, $expected)   X-Ref
Test the manager::is_empty_subsystem function.

param: string  $component
param: bool    $expected

is_empty_subsystem_provider()   X-Ref
Test cases for the is_empty_subsystem function.

return: array

test_get_contexts_for_userid_with_failing()   X-Ref
Test that get_contexts_for_userid() with a failing item.


test_export_user_data_with_failing()   X-Ref
Test that export_user_data() with a failing item.


test_delete_data_for_user_with_failing()   X-Ref
Test that delete_data_for_user() with a failing item.


test_delete_data_for_all_users_in_context_with_failing()   X-Ref
Test that delete_data_for_all_users_in_context() with a failing item.


test_get_metadata_for_components_with_failing()   X-Ref
Test that get_metadata_for_components() with a failing item.