Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 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.

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

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

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

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.

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

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

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

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

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

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.