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.

Differences Between: [Versions 39 and 401]

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