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.

Differences Between: [Versions 39 and 311]

Unit Tests for the request transform helper.

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

Defines 1 class

request_transform_test:: (5 methods):
  test_user()
  test_datetime()
  test_date()
  test_yesno()
  yesno_provider()


Class: request_transform_test  - X-Ref

Tests for the \core_privacy API's request transform helper functionality.

test_user()   X-Ref
Test that user translation currently does nothing.

We have not determined if we will do this or not, but we provide the functionality and encourgae people to use
it so that it can be retrospectively fitted if required.


test_datetime()   X-Ref
Test that the datetime is translated into a string.


test_date()   X-Ref
Test that the date is translated into a string.


test_yesno($input, $expected)   X-Ref
Ensure that the yesno function translates correctly.

param: mixed   $input The input to test
param: string  $expected The expected value

yesno_provider()   X-Ref
Data provider for tests of the yesno transformation.

return: array