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.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

Content bank repository search unit tests.

Copyright: 2020 Mihail Geshoski <mihail@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 246 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: search_test  - X-Ref

Tests for the content bank search class.

test_get_search_contents(array $contentnames, string $search, array $expected)   X-Ref
Test get_search_contents() by searching through some existing content using different search terms.

param: array $contentnames The array containing the names of the content that needs to be generated
param: string $search The search string
param: array $expected The array containing the expected content names that should be returned by the search

get_search_contents_provider()   X-Ref
Data provider for test_get_search_contents().

return: array

test_get_search_contents_user_can_access_all_content()   X-Ref
Test get_search_contents() by searching for content with users that have capability to access/view
all existing content bank content. By default, admins, managers should be able to view every existing content
that matches the search criteria.


test_get_search_contents_user_can_access_certain_content()   X-Ref
Test get_search_contents() by searching for content with users that have capability to access/view only
certain existing content bank content. By default, editing teachers should be able to view content that matches
the search criteria AND is in the courses they are enrolled, course categories of the enrolled courses
and system content. Other authenticated users should be able to access only the system content.