Differences Between: [Versions 310 and 402] [Versions 39 and 402]
This file contains the class that handles testing the calendar type system.
Copyright: | 2013 Mark Nelson <markn@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 331 lines (13 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
calendartype_test:: (10 methods):
setUp()
test_calendar_type_set()
test_calendar_type_core_functions()
test_calendar_type_dateselector_elements()
test_calendar_type_datetime_field_submission()
core_functions_test()
convert_dateselector_to_unixtime_test()
convert_unixtime_to_dateselector_test()
datetime_field_submission_test()
set_calendar_type()
temp_form_calendartype:: (2 methods):
definition()
getform()
Class: calendartype_test - X-Ref
Unit tests for the calendar type system.setUp() X-Ref |
Test set up. |
test_calendar_type_set() X-Ref |
Test that setting the calendar type works. |
test_calendar_type_core_functions() X-Ref |
Test that calling core Moodle functions responsible for displaying the date have the same results as directly calling the same function in the calendar type. |
test_calendar_type_dateselector_elements() X-Ref |
Test that dates selected using the date selector elements are being saved as unixtime, and that the unixtime is being converted back to a valid date to display in the date selector elements for different calendar types. |
test_calendar_type_datetime_field_submission() X-Ref |
Test that the user profile field datetime minimum and maximum year settings are saved as the equivalent Gregorian years. |
core_functions_test($type) X-Ref |
Test all the core functions that use the calendar type system. param: string $type the calendar type we want to test |
convert_dateselector_to_unixtime_test($element, $type, $date) X-Ref |
Simulates submitting a form with a date selector element and tests that the chosen dates are converted into unixtime before being saved in DB. param: string $element the form element we are testing param: string $type the calendar type we want to test param: array $date the date variables |
convert_unixtime_to_dateselector_test($type, $date) X-Ref |
Test converting dates from unixtime to a date for the calendar type specified. param: string $type the calendar type we want to test param: array $date the date variables |
datetime_field_submission_test($type, $date) X-Ref |
Test saving the minimum and max year settings for the user datetime field. param: string $type the calendar type we want to test param: array $date the date variables |
set_calendar_type($type) X-Ref |
Set the calendar type for this user. param: string $type the calendar type we want to set |