Search moodle.org's
Developer Documentation

See Release Notes

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

Differences Between: [Versions 402 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