Search moodle.org's
Developer Documentation

See Release Notes

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

(no description)

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

Defines 1 class


Class: helper_test  - X-Ref

Tests for the helper class.

test_create_preset(?string $name = null, ?string $comments = null, ?int $iscore = null,?int $iscoreresult = null)   X-Ref
Test the behaviour of create_preset() method.

param: string|null $name Preset name field.
param: string|null $comments Preset comments field.
param: int|null $iscore Preset iscore field.
param: int|null $iscoreresult Expected iscore value for the result preset.

create_preset_provider()   X-Ref
Data provider for test_create_preset().

return: array

test_add_item(string $name, string $value, ?string $plugin = 'none', ?string $advname = null,?string $advvalue = null)   X-Ref
Test the behaviour of add_item() method.

param: string $name Item name.
param: string $value Item value.
param: string|null $plugin Item plugin.
param: string|null $advname If the item is an advanced setting, the name of the advanced setting should be specified here.
param: string|null $advvalue If the item is an advanced setting, the value of the advanced setting should be specified here.

add_item_provider()   X-Ref
Data provider for test_add_item().

return: array

test_add_plugin(string $type, string $name, $enabled = 0)   X-Ref
Test the behaviour of add_plugin() method.

param: string $type Plugin type.
param: string $name Plugin name.
param: mixed $enabled Whether the plugin will be enabled or not.

add_plugin_provider()   X-Ref
Data provider for test_add_plugin().

return: array

test_change_default_preset(string $preset, ?array $settings = null, ?array $plugins = null)   X-Ref
Test the behaviour of change_default_preset() method.

param: string $preset The preset name to apply or the path to the XML to be imported and applied.
param: array|null $settings A few settings to check (with their expected values).
param: array|null $plugins A few module plugins to check (with their expected values for the visibility).

change_default_preset_provider()   X-Ref
Data provider for test_change_default_preset().

return: array