Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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: 437 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: block_html_privacy_testcase  - 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.