Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 400 and 402] [Versions 401 and 402]

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: 442 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