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.

Course global search unit tests.

Copyright: 2016 David Monllao {@link http://www.davidmonllao.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 659 lines (31 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: search_test  - X-Ref

Provides the unit tests for course global search.

setUp()   X-Ref


test_courses_indexing()   X-Ref
Indexing courses contents.

return: void

test_courses_indexing_contexts()   X-Ref
Tests course indexing support for contexts.


recordset_to_ids(\moodle_recordset $rs)   X-Ref
Utility function to convert recordset to array of IDs for testing.

param: moodle_recordset $rs Recordset to convert (and close)
return: array Array of IDs from records indexed by number (0, 1, 2, ...)

test_courses_document()   X-Ref
Document contents.

return: void

test_courses_access()   X-Ref
Document accesses.

return: void

test_section_indexing()   X-Ref
Indexing section contents.


test_section_document()   X-Ref
Document contents for sections.


test_section_access()   X-Ref
Document access for sections.


test_customfield_indexing()   X-Ref
Indexing custom fields contents.

return: void

test_customfield_document()   X-Ref
Document contents for custom fields.

return: void

test_customfield_access()   X-Ref
Document accesses for customfield area.


test_get_doc_icon_for_course_area()   X-Ref
Test document icon for course area.


test_get_doc_icon_for_section_area()   X-Ref
Test document icon for section area.


test_get_category_names()   X-Ref
Test assigned search categories.