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.

(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