Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Class: cache_testcase  - 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.