Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Class: factor_test  - X-Ref

Tests for MFA manager class.

setUp()   X-Ref
Holds specific requested factor, which is token factor.


test_calculate_expiry_time_in_general()   X-Ref
Test calculating expiry time in general

return: void

test_calculate_expiry_time_for_overnight_expiry_with_one_day_expiry($timestamp)   X-Ref
Everything should end at 2am unless adding the hours lands it between
0 <= x < 2am, which in that case it should just expire using the raw
value, provided it never goes past raw value expiry time, and when it
needs to be 2am, it's 2am on the following morning.

param: int $timestamp

test_calculate_expiry_time_for_overnight_expiry_with_two_day_expiry($timestamp)   X-Ref
Everything should end at 2am unless adding the hours lands it between
0 <= x < 2am, which in that case it should just expire using the raw
value, provided it never goes past raw value expiry time, and when it
needs to be 2am, it's 2am on the morning after tomorrow.

param: int $timestamp

test_calculate_expiry_time_for_overnight_expiry_with_three_hour_expiry($timestamp)   X-Ref
This should check if the 3am expiry is pushed back to 2am as expected, but everything else appears as expected

param: int $timestamp

test_calculate_expiry_time_for_overnight_expiry_with_an_hour_expiry($timestamp)   X-Ref
Only relevant based on the hour padding used, which is currently set to 2 hours (2am).

param: int $timestamp

timestamp_provider()   X-Ref
Timestamps for a 24 hour period starting from a fixed time.
Increments by 30 minutes to cover half hour and hour cases.
Starting timestamp: 2022-01-15 07:30:00 Australia/Melbourne time.