Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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.