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.

Class: cache_test  - X-Ref

Tests for cache.

test_get_enabled_tourdata_disabled()   X-Ref
Test that get_enabled_tourdata does not return disabled tours.


test_get_enabled_tourdata_enabled_no_steps()   X-Ref
Test that get_enabled_tourdata does not return an enabled but empty tour.


test_get_enabled_tourdata_enabled()   X-Ref
Test that get_enabled_tourdata returns a tour with steps.


test_get_enabled_tourdata_enabled_sortorder()   X-Ref
Test that get_enabled_tourdata returns tours in the correct sortorder


test_get_enabled_tourdata_single_fetch()   X-Ref
Test that caching prevents additional DB reads.


get_matching_tourdata_provider()   X-Ref
Data provider for get_matching_tourdata.

return: array

test_get_matching_tourdata($tourconfigs, $targetmatch, $expected)   X-Ref
Tests for the get_matching_tourdata function.

param: array   $tourconfigs    The configuration for the tours to create
param: string  $targetmatch    The match to be tested
param: array   $expected       An array containing the ordered names of the expected tours

test_notify_tour_change()   X-Ref
Test that notify_tour_change clears the cache.


test_get_stepdata_no_steps()   X-Ref
Test that get_stepdata returns an empty array when no steps were found.


test_get_stepdata_correct_tour()   X-Ref
Test that get_stepdata returns an empty array when no steps were found.


test_get_stepdata_ordered_steps()   X-Ref
Test that get_stepdata returns an array containing multiple steps in
the same order.

This is very difficult to determine because the act of changing the
order will likely change the DB natural sorting.

test_get_stepdata_single_fetch()   X-Ref
Test that caching prevents additional DB reads.


test_notify_step_change()   X-Ref
Test that notify_step_change clears the cache.