Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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.