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.

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

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

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

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

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.