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

Unit tests for the core_rating implementation of the Privacy API.

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

Defines 1 class


Class: provider_test  - X-Ref

Unit tests for the core_rating implementation of the Privacy API.

rate_as_user($userid, $component, $ratingarea, $itemid, $context, $score)   X-Ref
Rate something as a user.

param: int         $userid
param: string      $component
param: string      $ratingarea
param: int         $itemid
param: \context    $context
param: string      $score

test_get_sql_join()   X-Ref
Ensure that the get_sql_join function returns valid SQL which returns the correct list of rated itemids.


test_get_sql_join_inner()   X-Ref
Ensure that the get_sql_join function returns valid SQL which returns the correct list of rated itemids.
This makes use of the optional inner join argument.


test_export_area_ratings()   X-Ref
Ensure that export_area_ratings exports all ratings that a user has made, and all ratings for a users own content.


test_delete_ratings()   X-Ref
Test delete_ratings() method.


test_delete_ratings_select()   X-Ref
Test delete_ratings_select() method.


assert_has_rating($author, $score, $actual)   X-Ref
Assert that a user has the correct rating.

param: \stdClass   $author The user with the rating
param: int         $score The rating that was given
param: \stdClass[] The ratings which were found