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.

(no description)

File Size: 518 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: mustache_template_source_loader_test  - X-Ref

Unit tests for the Mustache source loader class.

Unit tests for lib/classes/output/mustache_template_source_loader.php

test_strip_template_comments()   X-Ref
Ensure that stripping comments from templates does not mutilate the template body.


load_test_cases()   X-Ref
Data provider for the test_load function.


test_load($loader, $component, $name, $includecomments, $expected)   X-Ref
Test the load function.

param: mustache_template_source_loader $loader The loader
param: string $component The moodle component
param: string $name The template name
param: bool $includecomments Whether to strip comments
param: string $expected The expected output

load_with_dependencies_test_cases()   X-Ref
Data provider for the load_with_dependencies function.


test_load_with_dependencies($loader, $component, $name, $includecomments, $expected)   X-Ref
Test the load_with_dependencies function.

param: mustache_template_source_loader $loader The loader
param: string $component The moodle component
param: string $name The template name
param: bool $includecomments Whether to strip comments
param: string $expected The expected output

scan_template_source_for_dependencies_test_cases()   X-Ref
Data provider for the test_load function.


test_scan_template_source_for_dependencies($loader, $source, $expected)   X-Ref
Test the scan_template_source_for_dependencies function.

param: mustache_template_source_loader $loader The loader
param: string $source The template to test
param: string $expected The expected output

build_loader_from_static_cache(array $cache)   X-Ref
Create an instance of mustache_template_source_loader which loads its templates
from the given cache rather than disk.

param: array $cache A cache of templates
return: mustache_template_source_loader