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.

Differences Between: [Versions 39 and 310]

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

Copyright: 2018 Ryan Wyllie <ryan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 526 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_output_mustache_template_source_loader_testcase  - X-Ref

Unit tests for the Mustache source loader class.

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