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.

Class: moodle_url_test  - X-Ref

Tests for moodle_url.

test_moodle_url_constructor()   X-Ref
Test basic moodle_url construction.


test_moodle_url_get_path()   X-Ref
Tests \moodle_url::get_path().


test_moodle_url_round_trip()   X-Ref
No description

test_moodle_url_empty_param_values()   X-Ref
Test Moodle URL objects created with a param with empty value.


test_moodle_url_set_good_scheme()   X-Ref
Test set good scheme on Moodle URL objects.


test_moodle_url_set_bad_scheme()   X-Ref
Test set bad scheme on Moodle URL objects.


test_moodle_url_round_trip_array_params()   X-Ref
No description

test_compare_url()   X-Ref
No description

test_out_as_local_url()   X-Ref
No description

test_out_as_local_url_error()   X-Ref
No description

test_modified_url_out_as_local_url_error()   X-Ref
You should get error with modified url


test_https_out_as_local_url_error()   X-Ref
Try get local url from external https url and you should get error


test_moodle_url_get_scheme()   X-Ref
No description

test_moodle_url_get_host()   X-Ref
No description

test_moodle_url_get_port()   X-Ref
No description

test_moodle_url_export_params_for_template(string $url, array $expected)   X-Ref
Test exporting params for templates.

param: string $url URL with params to test.
param: array $expected The expected result.

moodle_url_export_params_for_template_provider()   X-Ref
Data provider for moodle_url_export_params_for_template tests.

return: array[] the array of test data.

test_make_pluginfile_url($slashargs, $args, $expected)   X-Ref
Test the make_pluginfile_url function.

param: bool    $slashargs
param: array   $args Args to be provided to make_pluginfile_url
param: string  $expected The expected result

make_pluginfile_url_provider()   X-Ref
Data provider for make_pluginfile_url tests.

return: array[]