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.

Differences Between: [Versions 401 and 403]

(no description)

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

Defines 1 class

primary_test:: (5 methods):
  setUp()
  test_primary_export()
  primary_export_provider()
  test_get_custom_menu()
  custom_menu_provider()


Class: primary_test  - X-Ref

Primary navigation renderable test

setUp()   X-Ref
Basic setup to make sure the nav objects gets generated without any issues.


test_primary_export(bool $withcustom, bool $withlang, string $userloggedin, array $expecteditems)   X-Ref
Test the primary export to confirm we are getting the nodes

param: bool $withcustom Setup with custom menu
param: bool $withlang Setup with langs
param: string $userloggedin The type of user ('admin' or 'guest') if creating setup with logged in user,
param: array $expecteditems An array of nodes expected with content in them.

primary_export_provider()   X-Ref
Provider for the test_primary_export function.

return: array

test_get_custom_menu(string $config, array $expected)   X-Ref
Test the custom menu getter to confirm the nodes gets generated and are returned correctly.

param: string $config
param: array $expected

custom_menu_provider()   X-Ref
Provider for test_get_custom_menu

return: array