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.

(no description)

File Size: 320 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 3 files
 lib/tests/fixtures/hook/callbacks.php
 lib/tests/fixtures/hook/hook.php
 lib/tests/fixtures/hook/stoppablehook.php

Defines 2 classes


Class: manager_test  - X-Ref

Hooks tests.

test_get_instance()   X-Ref
Test public factory method to get hook manager.


test_phpunit_get_instance()   X-Ref
Test getting of manager test instance.


test_callbacks()   X-Ref
Test loading and parsing of callbacks from files.


Class: method  - X-Ref

test_dispatch()   X-Ref
Test hook dispatching, that is callback execution.


test_dispatch_with_exception()   X-Ref
Test hook dispatching, that is callback execution.


test_dispatch_with_invalid()   X-Ref
Test hook dispatching, that is callback execution.


test_dispatch_stoppable()   X-Ref
Test stoppping of hook dispatching.


test_callback_overriding()   X-Ref
Tests callbacks can be overridden via CFG settings.


normalise_callbacks(array &$callbacks)   X-Ref
Normalise the sort order of callbacks to help with asserts.

param: array $callbacks
return: void