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 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 1320 lines (50 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 1 class


Class: weblib_test  - X-Ref

Weblib tests.

test_format_string()   X-Ref


test_format_string_static_caching_with_filters()   X-Ref
The format string static caching should include the filters option to make
sure filters are correctly applied when requested.


test_s()   X-Ref


test_format_string_illegal_options(string $input,string $result,$options,string $pattern)   X-Ref
Test the format_string illegal options handling.


format_string_illegal_options_provider()   X-Ref
Data provider for test_format_string_illegal_options.

return: array

test_format_string_context()   X-Ref
Ensure that if format_string is called with a context as the third param, that a debugging notice is emitted.


test_format_text_email()   X-Ref


test_obfuscate_email()   X-Ref


test_obfuscate_text()   X-Ref


test_highlight()   X-Ref


test_replace_ampersands()   X-Ref


test_strip_links()   X-Ref


test_wikify_links()   X-Ref


test_clean_text()   X-Ref


test_trusttext_active()   X-Ref
Test trusttext enabling.


test_trusttext_trusted()   X-Ref
Test trusttext detection.


trusttext_pre_edit_provider()   X-Ref
Data provider for trusttext_pre_edit() tests.


test_trusttext_pre_edit(bool $expectedsanitised, int $enabled, string $rolename,string $format, int $trust)   X-Ref
Test text cleaning before editing.

param: bool $expectedsanitised
param: int $enabled
param: string $rolename
param: string $format
param: int $trust

test_trusttext_strip()   X-Ref
Test removal of legacy trusttext flag.


test_format_text_trusted()   X-Ref
Test trust option of format_text().


test_qualified_me()   X-Ref


test_null_progress_trace()   X-Ref


test_text_progress_trace()   X-Ref


test_html_progress_trace()   X-Ref


test_html_list_progress_trace()   X-Ref


test_progress_trace_buffer()   X-Ref


test_combined_progress_trace()   X-Ref


test_set_debugging()   X-Ref


test_strip_pluginfile_content()   X-Ref


test_purify_html_ruby()   X-Ref


test_content_to_text($content, $format, $expected)   X-Ref
Tests for content_to_text.

param: string    $content   The content
param: int|false $format    The content format
param: string    $expected  Expected value

provider_content_to_text()   X-Ref
Data provider for test_content_to_text.


data_validate_email()   X-Ref
Data provider for validate_email() function.

return: array Returns aray of test data for the test_validate_email function

test_validate_email($email, $result)   X-Ref
Tests valid and invalid email address using the validate_email() function.

param: string $email the email address to test
param: boolean $result Expected result (true or false)

provider_get_file_argument()   X-Ref
Data provider for test_get_file_argument.


test_get_file_argument($server, $cfgslasharguments, $expected)   X-Ref
Tests for get_file_argument() function.

param: array $server mockup for $_SERVER.
param: string $cfgslasharguments slasharguments setting.
param: string|false $expected Expected value.

test_extract_draft_file_urls_from_text()   X-Ref
Tests for extract_draft_file_urls_from_text() function.


test_print_password_policy()   X-Ref


get_html_lang_attribute_value_provider()   X-Ref
Data provider for the testing get_html_lang_attribute_value().

return: string[][]

test_get_html_lang_attribute_value(string $langcode, string $expected)   X-Ref
Test for get_html_lang_attribute_value().

param: string $langcode The language code to convert.
param: string $expected The expected converted value.
return: void

strip_querystring_provider()   X-Ref
Data provider for strip_querystring tests.

return: array

test_strip_querystring($value, $expected)   X-Ref
Test the strip_querystring function with various exampels.

param: mixed $value
param: mixed $expected