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.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Unit tests for the privacy legacy polyfill for quiz access rules.

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

Defines 3 classes

core_privacy_legacy_quizaccess_polyfill_test:: (4 methods):
  test_export_quizaccess_user_data()
  test_delete_quizaccess_for_context()
  test_delete_quizaccess_for_user()
  test_delete_quizaccess_for_users()

test_privacy_legacy_quizaccess_polyfill_provider:: (5 methods):
  _export_quizaccess_user_data()
  _delete_quizaccess_data_for_all_users_in_context()
  _delete_quizaccess_data_for_user()
  _delete_quizaccess_data_for_users()
  _get_metadata()

test_privacy_legacy_quizaccess_polyfill_mock_wrapper:: (1 method):
  get_return_value()


Class: core_privacy_legacy_quizaccess_polyfill_test  - X-Ref

Unit tests for the privacy legacy polyfill for quiz access rules.

test_export_quizaccess_user_data()   X-Ref
Test that the core_quizaccess\privacy\legacy_polyfill works and that the static _export_quizaccess_user_data can
be called.


test_delete_quizaccess_for_context()   X-Ref
Test the _delete_quizaccess_for_context shim.


test_delete_quizaccess_for_user()   X-Ref
Test the _delete_quizaccess_for_user shim.


test_delete_quizaccess_for_users()   X-Ref
Test the _delete_quizaccess_for_users shim.


Class: test_privacy_legacy_quizaccess_polyfill_provider  - X-Ref

Legacy polyfill test class for the quizaccess_provider.

_export_quizaccess_user_data($quiz, $user)   X-Ref
Export all user data for the quizaccess plugin.

param: \quiz $quiz
param: \stdClass $user

_delete_quizaccess_data_for_all_users_in_context($quiz)   X-Ref
Deletes all user data for the given context.

param: \quiz $quiz

_delete_quizaccess_data_for_user($quiz, $user)   X-Ref
Delete personal data for the given user and context.

param: \quiz           $quiz The quiz being deleted
param: \stdClass       $user The user to export data for

_delete_quizaccess_data_for_users($userlist)   X-Ref
Delete all user data for the specified users, in the specified context.

param: \core_privacy\local\request\approved_userlist   $userlist

_get_metadata(\core_privacy\local\metadata\collection $collection)   X-Ref
Returns metadata about this plugin.

param: \core_privacy\local\metadata\collection $collection The initialised collection to add items to.
return: \core_privacy\local\metadata\collection     A listing of user data stored through this system.

Class: test_privacy_legacy_quizaccess_polyfill_mock_wrapper  - X-Ref

Called inside the polyfill methods in the test polyfill provider, allowing us to ensure these are called with correct params.

get_return_value()   X-Ref
Get the return value for the specified item.