See Release Notes
Long Term Support Release
Differences Between: [Versions 401 and 402] [Versions 401 and 403]
This file contains the unit tests for the task logging system.
Copyright: | 2018 Andrew Nicols <andrew@nicols.co.uk> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 586 lines (17 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 1 file lib/tests/fixtures/task_fixtures.php |
logging_test:: (22 methods):
tearDown()
test_logmode_none()
test_start_logmode_all()
test_start_logmode_fail()
test_logmode_fail_with_passing_adhoc_task()
test_logmode_fail_with_passing_scheduled_task()
test_logmode_fail_with_failing_adhoc_task()
test_logmode_fail_with_failing_scheduled_task()
test_logmode_any_with_failing_adhoc_task()
test_logmode_any_with_failing_scheduled_task()
test_logmode_any_with_passing_adhoc_task()
test_logmode_any_with_passing_scheduled_task()
test_prevent_nested_logging()
test_repeated_usages()
test_finalise_log_no_logging()
test_flush_on_own_buffer()
test_flush_does_not_flush_inner_buffers()
test_inner_flushed_buffers_are_logged()
get_test_adhoc_task()
get_test_scheduled_task()
get_mocked_logger()
mock_database()
logging_test_mocked_logger:: (5 methods):
test_reset()
is_configured()
store_log_for_task()
has_log_report()
get_url_for_task_class()
Class: logging_test - X-Ref
This file contains the unit tests for the task logging system.tearDown() X-Ref |
Relevant tearDown for logging tests. |
test_logmode_none() X-Ref |
When the logmode is set to none, logging should not start. |
test_start_logmode_all() X-Ref |
When the logmode is set to all that log capture is started. |
test_start_logmode_fail() X-Ref |
When the logmode is set to fail that log capture is started. |
test_logmode_fail_with_passing_adhoc_task() X-Ref |
When the logmode is set to fail, passing adhoc tests should not be logged. |
test_logmode_fail_with_passing_scheduled_task() X-Ref |
When the logmode is set to fail, passing scheduled tests should not be logged. |
test_logmode_fail_with_failing_adhoc_task() X-Ref |
When the logmode is set to fail, failing adhoc tests should be logged. |
test_logmode_fail_with_failing_scheduled_task() X-Ref |
When the logmode is set to fail, failing scheduled tests should be logged. |
test_logmode_any_with_failing_adhoc_task() X-Ref |
When the logmode is set to fail, failing adhoc tests should be logged. |
test_logmode_any_with_failing_scheduled_task() X-Ref |
When the logmode is set to fail, failing scheduled tests should be logged. |
test_logmode_any_with_passing_adhoc_task() X-Ref |
When the logmode is set to fail, passing adhoc tests should be logged. |
test_logmode_any_with_passing_scheduled_task() X-Ref |
When the logmode is set to fail, passing scheduled tests should be logged. |
test_prevent_nested_logging() X-Ref |
Ensure that start_logging cannot be called in a nested fashion. |
test_repeated_usages() X-Ref |
Ensure that logging can be called after a previous log has finished. |
test_finalise_log_no_logging() X-Ref |
Enusre that when finalise_log is called when logging is not active, nothing happens. |
test_flush_on_own_buffer() X-Ref |
When log capture is enabled, calls to the flush function should cause log output to be both returned and captured. |
test_flush_does_not_flush_inner_buffers() X-Ref |
When log capture is enabled, calls to the flush function should not affect any subsequent ob_start. |
test_inner_flushed_buffers_are_logged() X-Ref |
When log capture is enabled, calls to the flush function should not affect any subsequent ob_start. |
get_test_adhoc_task() X-Ref |
Get an example adhoc task to use for testing. return: adhoc_task |
get_test_scheduled_task() X-Ref |
Get an example scheduled task to use for testing. return: scheduled_task |
get_mocked_logger() X-Ref |
Create and configure a mocked task logger. return: task_logger |
mock_database() X-Ref |
Mock the database. |
Class: logging_test_mocked_logger - X-Ref
Mocked logger.test_reset() X-Ref |
Reset the test class. |
is_configured() X-Ref |
Whether the task is configured and ready to log. return: bool |
store_log_for_task(task_base $task, string $logpath, bool $failed,int $dbreads, int $dbwrites, float $timestart, float $timeend) X-Ref |
Store the log for the specified task. param: task_base $task The task that the log belongs to. param: string $logpath The path to the log on disk param: bool $failed Whether the task failed param: int $dbreads The number of DB reads param: int $dbwrites The number of DB writes param: float $timestart The start time of the task param: float $timeend The end time of the task |
has_log_report() X-Ref |
Whether this task logger has a report available. return: bool |
get_url_for_task_class(string $classname) X-Ref |
Get any URL available for viewing relevant task log reports. param: string $classname The task class to fetch for return: \moodle_url |