[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/calendar/tests/ -> calendartype_test.php (summary)

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: 302 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_calendar_type_testcase:: (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()


Class: core_calendar_type_testcase  - 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



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1