Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 and 403]

Unit tests for the block_html implementation of the privacy API.

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 438 lines (15 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 the block_html implementation of the privacy API.

get_format_options()   X-Ref
Get the list of standard format options for comparison.

return: \stdClass

create_user_block($title, $body, $format)   X-Ref
Creates an HTML block on a user.

return: \block_instance
param: string  $title
param: string  $body
param: string  $format

create_course_block($course, $title, $body, $format)   X-Ref
Creates an HTML block on a course.

return: \block_instance
param: \stdClass $course
param: string  $title
param: string  $body
param: string  $format

create_block($page)   X-Ref
Creates an HTML block on a page.

param: \page $page Page

get_last_block_on_page($page)   X-Ref
Get the last block on the page.

return: \block_html Block instance object
param: \page $page Page

construct_user_page(\stdClass $user)   X-Ref
Constructs a Page object for the User Dashboard.

return: \moodle_page
param: \stdClass       $user User to create Dashboard for.

construct_course_page(\stdClass $course)   X-Ref
Constructs a Page object for the User Dashboard.

return: \moodle_page
param: \stdClass       $course Course to create Dashboard for.

test_user_block()   X-Ref
Test that a block on the dashboard is exported.


test_user_block_unconfigured()   X-Ref
Test that a block on the dashboard which is not configured is _not_ exported.


test_user_multiple_blocks_exported()   X-Ref
Test that a block on the dashboard is exported.


test_course_blocks_not_exported()   X-Ref
Test that a block on the dashboard is not exported.


test_mixed_multiple_blocks_exported()   X-Ref
Test that a block on the dashboard is exported.


test_get_users_in_context()   X-Ref
Test that only users with a user context HTML block are fetched.


test_delete_data_for_users()   X-Ref
Test that data for users in approved userlist is deleted.