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 310 and 402] [Versions 39 and 402]

(no description)

File Size: 365 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 admin/tool/usertours/tests/helper_trait.php

Defines 1 class


Class: manager_test  - X-Ref

Tests for step.

setUp()   X-Ref
Setup to store the DB reference.


tearDown()   X-Ref
Tear down to restore the original DB reference.


mock_database()   X-Ref
Helper to mock the database.

return: moodle_database

sesskey_required_provider()   X-Ref
Data provider to ensure that all modification actions require the session key.

return: array

test_sesskey_required($function, $arguments)   X-Ref
Ensure that all modification actions require the session key.

param: string  $function   The function to test
param: array   $arguments  The arguments to pass with it

move_tour_provider()   X-Ref
Data provider for test_move_tour

return: array

test_move_tour($alltours, $movetourname, $direction, $expectedsortorder)   X-Ref
Test moving tours (changing sortorder)

param: array $alltours
param: string $movetourname
param: int $direction
param: int $expectedsortorder
return: void

get_matching_tours_provider()   X-Ref
Data Provider for get_matching_tours tests.

return: array

test_get_matching_tours(array $alltours, string $url, array $expected)   X-Ref
Tests for the get_matching_tours function.

param: array   $alltours   The list of tours to insert.
param: string  $url        The URL to test.
param: array   $expected   List of names of the expected matching tours.

test_get_matching_tours_for_user_without_site_policy_agreed()   X-Ref
Test that no matching tours are returned if there is pending site policy agreement.