Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

(no description)

File Size: 805 lines (33 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 6 classes

navigationlib_test:: (35 methods):
  setup_node()
  test_node__construct()
  test_node_add()
  test_node_add_before()
  test_node_add_class()
  test_node_check_if_active()
  test_node_contains_active_node()
  test_node_find_active_node()
  test_node_find()
  test_node_find_expandable()
  test_node_get()
  test_node_get_css_type()
  test_node_make_active()
  test_node_remove()
  test_node_remove_class()
  test_module_extends_navigation()
  test_navbar_prepend_and_add()
  test_navbar_has_items()
  test_cache__get()
  test_cache__set()
  test_cache_cached()
  test_cache_clear()
  test_cache_set()
  test_setting___construct()
  test_setting__initialise()
  test_can_view_user_preferences()
  test_setting_in_alternative_role()
  test_navigation_node_collection_remove_with_no_type()
  test_navigation_node_collection_remove_with_type()
  test_set_force_into_more_menu()
  set_force_into_more_menu_provider()
  test_is_action_link()
  is_action_link_provider()
  test_action_link_actions()
  action_link_actions_provider()

exposed_global_navigation:: (3 methods):
  __construct()
  __call()
  set_initialised()

mock_initialise_global_navigation:: (4 methods):
  load_for_category()
  load_for_course()
  load_for_activity()
  load_for_user()

exposed_navbar:: (2 methods):
  __construct()
  __call()

navigation_exposed_moodle_page:: (1 method):
  set_navigation()

exposed_settings_navigation:: (2 methods):
  __construct()
  __call()


Class: navigationlib_test  - X-Ref

Unit tests for lib/navigationlib.php

setup_node()   X-Ref


test_node__construct()   X-Ref
No description

test_node_add()   X-Ref
No description

test_node_add_before()   X-Ref
No description

test_node_add_class()   X-Ref
No description

test_node_check_if_active()   X-Ref
No description

test_node_contains_active_node()   X-Ref
No description

test_node_find_active_node()   X-Ref
No description

test_node_find()   X-Ref
No description

test_node_find_expandable()   X-Ref
No description

test_node_get()   X-Ref
No description

test_node_get_css_type()   X-Ref
No description

test_node_make_active()   X-Ref
No description

test_node_remove()   X-Ref
No description

test_node_remove_class()   X-Ref
No description

test_module_extends_navigation()   X-Ref
No description

test_navbar_prepend_and_add()   X-Ref
No description

test_navbar_has_items(\moodle_page $page)   X-Ref

param: $node

test_cache__get()   X-Ref
No description

test_cache__set()   X-Ref
No description

test_cache_cached()   X-Ref
No description

test_cache_clear()   X-Ref
No description

test_cache_set()   X-Ref
No description

test_setting___construct()   X-Ref
No description

test_setting__initialise($node)   X-Ref

param: mixed $node
return: mixed

test_can_view_user_preferences()   X-Ref
Test that users with the correct permissions can view the preferences page.


test_setting_in_alternative_role($node)   X-Ref

param: mixed $node
return: mixed

test_navigation_node_collection_remove_with_no_type()   X-Ref
No description

test_navigation_node_collection_remove_with_type()   X-Ref
No description

test_set_force_into_more_menu(bool $haschildren, bool $forceintomoremenu)   X-Ref
Test the set_force_into_more_menu method.

param: bool $haschildren       Whether the navigation node has children nodes
param: bool $forceintomoremenu Whether to force the navigation node and its children into the "more" menu

set_force_into_more_menu_provider()   X-Ref
Data provider for the test_set_force_into_more_menu function.

return: array

test_is_action_link(navigation_node $node, bool $expected)   X-Ref
Test the is_action_link method.

param: navigation_node $node The sample navigation node
param: bool $expected Whether the navigation node contains an action link

is_action_link_provider()   X-Ref
Data provider for the test_is_action_link function.

return: array

test_action_link_actions(navigation_node $node)   X-Ref
Test the action_link_actions method.

param: navigation_node $node The sample navigation node

action_link_actions_provider()   X-Ref
Data provider for the test_action_link_actions function.

return: array

Class: exposed_global_navigation  - X-Ref

This is a dummy object that allows us to call protected methods within the
global navigation class by prefixing the methods with `exposed_`

__construct(\moodle_page $page=null)   X-Ref
No description

__call($method, $arguments)   X-Ref
No description

set_initialised()   X-Ref
No description

Class: mock_initialise_global_navigation  - X-Ref

load_for_category()   X-Ref
No description

load_for_course()   X-Ref
No description

load_for_activity()   X-Ref
No description

load_for_user($user=null, $forceforcontext=false)   X-Ref
No description

Class: exposed_navbar  - X-Ref

This is a dummy object that allows us to call protected methods within the
global navigation class by prefixing the methods with `exposed_`.

__construct(\moodle_page $page)   X-Ref
No description

__call($method, $arguments)   X-Ref
No description

Class: navigation_exposed_moodle_page  - X-Ref

set_navigation(navigation_node $node)   X-Ref
No description

Class: exposed_settings_navigation  - X-Ref

This is a dummy object that allows us to call protected methods within the
global navigation class by prefixing the methods with `exposed_`.

__construct()   X-Ref
No description

__call($method, $arguments)   X-Ref
No description