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.

Unit tests for lib/outputcomponents.php.

Copyright: 2011 David Mudrak <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 248 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: icon_system_test  - X-Ref

Unit tests for the `icon_system` class.

test_is_valid_subsystem(string $parent, string $system, bool $expected)   X-Ref
Check whether the supplied classes are valid icon subsystems of the supplied one.

param: string $parent The class to call ::is_valid_system() on
param: string $system The class to request
param: bool $expected Whether the supplied relationship is valid

test_invalid_instance(string $parent, string $system)   X-Ref
Ensure that the ::instance() function throws an appropriate Exception when an inappropriate relationship is
specified.

param: string $parent The class to call ::instance() on
param: string $system The class to request

test_valid_instance(string $parent, string $system)   X-Ref
Ensure that the ::instance() function returns an instance of the supplied system for a valid icon system
relationship.

param: string $parent The class to call ::instance() on
param: string $system The class to request

test_instance_singleton()   X-Ref
Ensure that subsequent calls without arguments to ::instance() return the exact same instance.


test_instance_singleton_named_default()   X-Ref
Ensure thaat subsequent calls with an argument to ::instance() return the exact same instance.


test_instance_singleton_named(string $parent, string $child)   X-Ref
Ensure that ::instance() returns an instance of the correct icon system when requested on the core icon_system
class.

param: string $parent The class to call ::instance() on
param: string $child The class to request

test_instance_singleton_named_child(string $parent, string $child)   X-Ref
Ensure that ::instance() returns an instance of the correct icon system when called on a named parent class.

param: string $parent The class to call ::instance() on
param: string $child The class to request

test_instance_singleton_reset()   X-Ref
Ensure that the ::reset_caches() function resets the stored instance such that ::instance() returns a new
instance in subsequent calls.


icon_system_provider()   X-Ref
Returns data for data providers containing:
- parent icon system
- child icon system
- whether it is a valid child

return: array

is_valid_subsystem_provider()   X-Ref
Data provider for tests of `is_valid`.

return: array

invalid_instance_provider()   X-Ref
Data provider for tests of `instance` containing only invalid tests.

return: array

valid_instance_provider()   X-Ref
No description