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 privacy legacy polyfill for portfolio.

Copyright: 2018 Jake Dallimore <jrhdallimore@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 163 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

core_portfolio_privacy_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: core_portfolio_privacy_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.