Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Subplugin test helper trait

Author: Laurent David (laurent@call-learning.fr)
Copyright: 2023 - present, Blindside Networks Inc
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 170 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 functions


Functions that are not part of a class:

setup_fake_plugin(string $pluginname)   X-Ref
Setup a fake extension plugin

This is intended to behave in most case like a real subplugina and will
allow most functionalities to be tested.

param: string $pluginname plugin name
return: void

write_fake_component_cache($content)   X-Ref
Write the content of the cache in a file for later use.

This is used exclusively in behat test as the cache is filled with new values at each session/page load.

param: string $content content of the cache
return: void

uninstall_fake_plugin(string $pluginname)   X-Ref
Uninstall a fake extension plugin

This is intended to behave in most case like a real subplugina and will
allow most functionalities to be tested.

param: string $pluginname plugin name
return: void