Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310]

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: 241 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: repository_contentbank_search_testcase  - 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.