Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

Course related unit tests

Copyright: 2014 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 276 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

core_course_courseformat_testcase:: (5 methods):
  test_courseformat_saveandload()
  test_available_hook()
  test_supports_news()
  test_supports_news_legacy()
  test_get_view_url()

format_testformat:: (1 method):
  get_default_blocks()

format_testlegacy:: (1 method):
  get_default_blocks()


Class: core_course_courseformat_testcase  - X-Ref

test_courseformat_saveandload()   X-Ref
Tests the save and load functionality.

author: Jason den Dulk

test_available_hook()   X-Ref
No description

test_supports_news()   X-Ref
Test for supports_news() with a course format plugin that doesn't define 'news_items' in default blocks.


test_supports_news_legacy()   X-Ref
Test for supports_news() for old course format plugins that defines 'news_items' in default blocks.


test_get_view_url()   X-Ref
Test for get_view_url() to ensure that the url is only given for the correct cases


Class: format_testformat  - X-Ref

Class format_testformat.

A test class that simulates a course format that doesn't define 'news_items' in default blocks.

get_default_blocks()   X-Ref
Returns the list of blocks to be automatically added for the newly created course.

return: array

Class: format_testlegacy  - X-Ref

Class format_testlegacy.

A test class that simulates old course formats that define 'news_items' in default blocks.

get_default_blocks()   X-Ref
Returns the list of blocks to be automatically added for the newly created course.

return: array