Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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.