Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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.

Class: repository_contentbank_browser_testcase  - X-Ref

Tests for the content bank browser class.

test_get_content_system_context_user_has_capabilities()   X-Ref
Test get_content() in the system context with users that have capability to access/view content bank content
within the system context. By default, every authenticated user should be able to access/view the content in
the system context.


test_get_content_system_context_user_missing_capabilities()   X-Ref
Test get_content() in the system context with users that do not have a capability to access/view content bank
content within the system context. By default, every non-authenticated user should not be able to access/view
the content in the system context.


test_get_content_course_category_context_user_has_capabilities()   X-Ref
Test get_content() in the course category context with users that have capability to access/view content
bank content within the course category context. By default, every authenticated user that has access to
any category course should be able to access/view the content in the course category context.


test_get_content_course_category_context_user_missing_capabilities()   X-Ref
Test get_content() in the course category context with users that do not have capability to access/view content
bank content within the course category context. By default, every non-authenticated user or authenticated users
that cannot access/view course content from the course category should not be able to access/view the
content in the course category context.


test_get_content_course_context_user_has_capabilities()   X-Ref
Test get_content() in the course context with users that have capability to access/view content
bank content within the course context. By default, admin, managers, course creators, editing teachers enrolled
in the course should be able to access/view the content.


test_get_content_course_context_user_missing_capabilities()   X-Ref
Test get_content() in the course context with users that do not have capability to access/view content
bank content within the course context. By default, every user which is not an admin, manager, course creator,
editing teacher enrolled in the course should not be able to access/view the content.


test_get_navigation_system_context()   X-Ref
Test get_navigation() in the system context.


test_get_navigation_course_category_context()   X-Ref
Test get_navigation() in the course category context.


test_get_navigation_course_context()   X-Ref
Test get_navigation() in the course context.


generate_expected_content(array $contextfolders = [], array $contentbankcontents = [])   X-Ref
Generate the expected array of content bank nodes.

param: array $contextfolders The array containing the expected folder nodes
param: array $contentbankcontents The array containing the expected contents
return: array[] The expected array of content bank nodes