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.

Class: browser_test  - 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