Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

Tests for manager.

Copyright: 2016 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 334 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 admin/tool/usertours/tests/helper_trait.php

Defines 1 class

tool_usertours_manager_testcase:: (9 methods):
  setUp()
  tearDown()
  mock_database()
  sesskey_required_provider()
  test_sesskey_required()
  move_tour_provider()
  test_move_tour()
  get_matching_tours_provider()
  test_get_matching_tours()


Class: tool_usertours_manager_testcase  - 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($alltours, $url, $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: string  $expected   The name of the expected matching tour