Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Class: course_image_cache_test  - X-Ref

Functional test for class course_image

setUp()   X-Ref
Initial setup.


fill_draft_area(array $files)   X-Ref
Helper method to create a draft area for current user and fills it with fake files

return: int draftid for the filearea
param: array $files array of files that need to be added to filearea, filename => filecontents

build_expected_course_image_url(\stdClass $course, string $filename)   X-Ref
A helper method to generate expected file URL.

return: string
param: \stdClass $course Course object.
param: string $filename File name.

test_getting_data_if_course_is_not_exist()   X-Ref
Test exception if try to get an image for non existing course.


test_get_image_url_from_overview_files_return_null_if_no_summary_files_in_the_course()   X-Ref
Test get_image_url_from_overview_files when no summary files in the course.


test_get_image_url_from_overview_files_returns_null_if_no_summary_images_in_the_course()   X-Ref
Test get_image_url_from_overview_files when no summary images in the course.


test_get_image_url_from_overview_files_returns_url_if_there_is_a_summary_image()   X-Ref
Test get_image_url_from_overview_files when no summary images in the course.


test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_images()   X-Ref
Test get_image_url_from_overview_files when several summary images in the course.


test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_files()   X-Ref
Test get_image_url_from_overview_files when several summary files in the course.