Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401] [Versions 401 and 402] [Versions 401 and 403]

Setting tests (all).

Copyright: 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 533 lines (24 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 6 classes

settings_test:: (7 methods):
  test_base_setting()
  test_dependency_empty_locked_by_permission_child_is_not_unlocked()
  test_dependency_not_empty_locked_by_config_parent_is_unlocked()
  test_backup_setting()
  test_activity_backup_setting()
  test_section_backup_setting()
  test_course_backup_setting()

mock_base_setting:: (3 methods):
  get_vtype()
  process_change()
  get_ui_info()

mock_backup_setting:: (2 methods):
  set_level()
  process_change()

mock_activity_backup_setting:: (1 method):
  process_change()

mock_section_backup_setting:: (1 method):
  process_change()

mock_course_backup_setting:: (2 methods):
  process_change()
  backup_setting_error_handler()


Class: settings_test  - X-Ref

Setting tests (all).

test_base_setting()   X-Ref
test base_setting class


test_dependency_empty_locked_by_permission_child_is_not_unlocked()   X-Ref
Test that locked and unlocked states on dependent backup settings at the same level
correctly do not flow from the parent to the child setting when the setting is locked by permissions.


test_dependency_not_empty_locked_by_config_parent_is_unlocked()   X-Ref
Test that locked and unlocked states on dependent backup settings at the same level
correctly do flow from the parent to the child setting when the setting is locked by config.


test_backup_setting()   X-Ref
test backup_setting class


test_activity_backup_setting()   X-Ref
test activity_backup_setting class


test_section_backup_setting()   X-Ref
test section_backup_setting class


test_course_backup_setting()   X-Ref
test course_backup_setting class


Class: mock_base_setting  - X-Ref

helper extended base_setting class that makes some methods public for testing

get_vtype()   X-Ref
No description

process_change($setting, $ctype, $oldv)   X-Ref
No description

get_ui_info()   X-Ref
No description

Class: mock_backup_setting  - X-Ref

helper extended backup_setting class that makes some methods public for testing

set_level($level)   X-Ref
No description

process_change($setting, $ctype, $oldv)   X-Ref
No description

Class: mock_activity_backup_setting  - X-Ref

helper extended activity_backup_setting class that makes some methods public for testing

process_change($setting, $ctype, $oldv)   X-Ref
No description

Class: mock_section_backup_setting  - X-Ref

helper extended section_backup_setting class that makes some methods public for testing

process_change($setting, $ctype, $oldv)   X-Ref
No description

Class: mock_course_backup_setting  - X-Ref

helper extended course_backup_setting class that makes some methods public for testing

process_change($setting, $ctype, $oldv)   X-Ref
No description

backup_setting_error_handler($errno, $errstr, $errfile, $errline)   X-Ref
This error handler is used to convert errors to excpetions so that simepltest can
catch them.

This is required in order to catch type hint mismatches that result in a error
being thrown. It should only ever be used to catch E_RECOVERABLE_ERROR's.

It throws a backup_setting_exception with 'incorrect_object_passed'

param: int $errno E_RECOVERABLE_ERROR
param: string $errstr
param: string $errfile
param: int $errline
return: null