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.

Unit tests for all Privacy Providers.

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 332 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: provider_test  - X-Ref

Unit tests for all Privacy Providers.

get_component_list()   X-Ref
Returns a list of frankenstyle names of core components (plugins and subsystems).

return: array the array of frankenstyle component names with the relevant class name.

test_null_provider($component, $classname)   X-Ref
Test that the specified null_provider works as expected.

param: string  $component The name of the component.
param: string  $classname The name of the class for privacy

null_provider_provider()   X-Ref
Data provider for the null_provider tests.

return: array

test_metadata_provider($component, $classname)   X-Ref
Test that the specified metadata_provider works as expected.

param: string  $component The name of the component.
param: string  $classname The name of the class for privacy

test_all_providers_compliant($component, $classname)   X-Ref
Test that all providers implement some form of compliant provider.

param: string $component frankenstyle component name, e.g. 'mod_assign'
param: string $classname the fully qualified provider classname

test_component_understands_deleted_users($component)   X-Ref
Ensure that providers do not throw an error when processing a deleted user.

param: string  $component

test_userdata_provider_implements_userlist($component)   X-Ref
Ensure that providers do not throw an error when processing a deleted user.

param: string  $component

metadata_provider_provider()   X-Ref
Data provider for the metadata\provider tests.

return: array

is_user_data_provider()   X-Ref
List of providers which implement the core_user_data_provider.

return: array

component_implements($providerclass, $interface)   X-Ref
Checks whether the component's provider class implements the specified interface, either directly or as a grandchild.

param: string  $providerclass The name of the class to test.
param: string  $interface the name of the interface we want to check.
return: bool    Whether the class implements the interface.

get_userid_fields(\xmldb_table $table)   X-Ref
Finds user fields in a table

Returns fields that have foreign key to user table and fields that are named 'userid'.

param: \xmldb_table $table
return: array

test_table_coverage()   X-Ref
Test that all tables with user fields are covered by metadata providers