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.

(no description)

File Size: 158 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

legacy_polyfill_test:: (4 methods):
  test_export_portfolio_user_data()
  test_get_metadata()
  test_delete_portfolio_for_context()
  test_delete_portfolio_for_user()

test_legacy_polyfill_portfolio_provider:: (4 methods):
  _export_portfolio_user_data()
  _delete_portfolio_for_context()
  _delete_portfolio_for_user()
  _get_metadata()

test_portfolio_legacy_polyfill_mock_wrapper:: (1 method):
  get_return_value()


Class: legacy_polyfill_test  - X-Ref

Unit tests for the Portfolio API's privacy legacy_polyfill.

test_export_portfolio_user_data()   X-Ref
Test that the core_portfolio\privacy\legacy_polyfill works and that the static _export_portfolio_user_data can be called.


test_get_metadata()   X-Ref
Test for _get_metadata shim.


test_delete_portfolio_for_context()   X-Ref
Test the _delete_portfolio_for_context shim.


test_delete_portfolio_for_user()   X-Ref
Test the _delete_portfolio_for_context shim.


Class: test_legacy_polyfill_portfolio_provider  - X-Ref

Legacy polyfill test class for the portfolio_provider.

_export_portfolio_user_data($userid, \context $context, array $subcontext, array $linkarray)   X-Ref
Export all user data for the portfolio plugin.

param: int $userid
param: context $context
param: array $subcontext
param: array $linkarray

_delete_portfolio_for_context(\context $context)   X-Ref
Deletes all user data for the given context.

param: context $context

_delete_portfolio_for_user($userid, \context $context)   X-Ref
Delete personal data for the given user and context.

param: int $userid
param: context $context

_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_portfolio_legacy_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.