Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

(no description)

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

Defines 1 class


Class: database_logger_test  - X-Ref

This file contains the unit tests for the database task logger.

setUp()   X-Ref
Setup to backup the database before mocking.


tearDown()   X-Ref
Tear down to unmock the database where it was mocked.


test_store_log_for_task_scheduled()   X-Ref
Ensure that store_log_for_task works with a passing scheduled task.


test_store_log_for_task_adhoc()   X-Ref
Ensure that store_log_for_task works with a passing adhoc task.


test_store_log_for_task_failed_scheduled()   X-Ref
Ensure that store_log_for_task works with a failing scheduled task.


test_store_log_for_task_failed_adhoc()   X-Ref
Ensure that store_log_for_task works with a failing adhoc task.


test_store_log_for_task_adhoc_userid()   X-Ref
Ensure that store_log_for_task works with a passing adhoc task run as a specific user.


test_delete_task_logs($ids)   X-Ref
Ensure that the delete_task_logs function performs necessary deletion tasks.

param: mixed   $ids

delete_task_logs_provider()   X-Ref
Data provider for delete_task_logs tests.

return: array

test_cleanup_retention()   X-Ref
Ensure that the retention period applies correctly.


test_cleanup_retainruns()   X-Ref
Ensure that the run-count retention applies.


test_cleanup_combined()   X-Ref
Ensure that the retention period applies correctly when combined with the run count retention.


mock_database()   X-Ref
Mock the database.