Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

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

Defines 1 class


Class: primary_test  - X-Ref

Class core_primary_testcase

Unit test for the primary nav view.

test_setting_initialise($usertype, $expected)   X-Ref
Test the initialise in different contexts

param: string $usertype The user to setup for - admin, guest, regular user
param: string $expected The expected nodes

setting_initialise_provider()   X-Ref
Data provider for the test_setting_initialise function


get_tree_initilised_to_set_activate(?string $seturl = null)   X-Ref
Get the nav tree initialised to test search_and_set_active_node.

param: string|null $seturl The url set for $PAGE.
return: navigation_node The initialised nav tree.

test_search_and_set_active_node(string $expectedkey, ?string $key = null, ?string $seturl = null)   X-Ref
Testing search_and_set_active_node.

param: string $expectedkey Expected key of the node, if set.
param: string|null $key The key of the node to activate.
param: string|null $seturl Set the url for $PAGE.
return: void

search_and_set_active_node_provider()   X-Ref
Data provider for test_search_and_set_active_node

return: array