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.

Differences Between: [Versions 310 and 400] [Versions 39 and 400]

(no description)

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

Defines 2 classes

progress_test:: (8 methods):
  test_basic()
  test_nested()
  test_nested_weighted()
  test_realistic()
  test_zero()
  test_exceptions()
  test_progress_change()
  assert_min_max()

core_mock_progress:: (4 methods):
  was_update_called()
  step_time()
  update_progress()
  get_time()


Class: progress_test  - X-Ref

Unit tests for the progress classes.

test_basic()   X-Ref
Tests for basic use with simple numeric progress.


test_nested()   X-Ref
Tests progress that is nested and/or indeterminate.


test_nested_weighted()   X-Ref
Tests the feature for 'weighting' nested progress.


test_realistic()   X-Ref
I had some issues with real use in backup/restore, this test is intended
to be similar.


test_zero()   X-Ref
To avoid causing problems, progress needs to work for sections that have
zero entries.


test_exceptions()   X-Ref
Tests for any exceptions due to invalid calls.


test_progress_change()   X-Ref
No description

assert_min_max($min, $max, core_mock_progress $progress)   X-Ref
Checks the current progress values are as expected.

param: number $min Expected min progress
param: number $max Expected max progress
param: core_mock_progress $progress

Class: core_mock_progress  - X-Ref

Helper class that records when update_progress is called and allows time
stepping.

was_update_called()   X-Ref
Checks if update was called since the last call to this function.

return: boolean True if update was called

step_time()   X-Ref
Steps the current time by 1 second.


update_progress()   X-Ref
No description

get_time()   X-Ref
No description