Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 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: 247 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

core_course_courseformat_testcase:: (4 methods):
  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_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