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 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

(no description)

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

Defines 1 class


Class: fields_test  - X-Ref

Unit tests for \core_user\fields

test_get_picture_fields()   X-Ref
Tests getting the user picture fields.


test_get_name_fields()   X-Ref
Tests getting the user name fields.


test_get_identity_fields()   X-Ref
Tests getting the identity fields.


test_get_required_fields()   X-Ref
Tests the get_required_fields function.

This function composes the results of get_identity/name/picture_fields, so we are not going
to test the details of the identity permissions as that was already covered. Just how they
are included/combined.

test_get_required_fields_limitpurposes()   X-Ref
Tests the get_required_fields function when you use the $limitpurposes parameter.


test_get_required_fields_limitpurposes_not_in_constructor()   X-Ref
There should be an exception if you try to 'limit' purposes to one that wasn't even included.


init_for_sql_tests()   X-Ref
Sets up data and a fields object for all the get_sql tests.

return: fields Constructed fields object for testing

test_get_sql_variations()   X-Ref
Tests getting SQL (and actually using it).


test_get_sql_multiple()   X-Ref
Tests what happens if you use the SQL multiple times in a query (i.e. that it correctly
creates the different identifiers).


test_get_sql_nothing()   X-Ref
Tests the get_sql function when there are no fields to retrieve.


test_get_sql_no_custom_fields()   X-Ref
Tests get_sql when there are no custom fields; in this scenario, the joins and joinparams
are always blank.


test_get_sql_selects_format()   X-Ref
Tests the format of the $selects string, which is important particularly for backward
compatibility.