Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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.

Differences Between: [Versions 39 and 310]

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

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 505 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: task_database_logger_testcase  - 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.