Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Unit tests for the HTMLPurifier integration

Copyright: 2012 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 513 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

core_htmlpurifier_testcase:: (16 methods):
  test_allow_blank_target()
  test_nolink()
  test_tex()
  test_algebra()
  test_multilang()
  test_format_text_allowid()
  test_allowobjectembed()
  test_line_breaking()
  test_tidy()
  test_nested_lists()
  test_cleaning_nastiness()
  test_is_purify_html_necessary()
  test_allowed_schemes()
  test_idn()
  test_media_tags()
  media_tags_provider()

but:: (0 methods):

but:: (0 methods):


Class: core_htmlpurifier_testcase  - X-Ref

HTMLPurifier test case

test_allow_blank_target()   X-Ref
Verify _blank target is allowed.


test_nolink()   X-Ref
Verify our nolink tag accepted.


test_tex()   X-Ref
Verify our tex tag accepted.


test_algebra()   X-Ref
Verify our algebra tag accepted.


test_multilang()   X-Ref
Verify our hacky multilang works.


test_format_text_allowid()   X-Ref
Tests the 'allowid' option for format_text.


test_allowobjectembed()   X-Ref
No description

test_line_breaking()   X-Ref
Test if linebreaks kept unchanged.


test_tidy()   X-Ref
Test fixing of strict problems.


test_nested_lists()   X-Ref
Test nesting - this used to cause problems in earlier versions.


test_cleaning_nastiness()   X-Ref
Test that XSS protection works, complete smoke tests are in htmlpurifier itself.


test_is_purify_html_necessary()   X-Ref
Test internal function used for clean_text() speedup.


test_allowed_schemes()   X-Ref
No description

test_idn()   X-Ref
Test non-ascii domain names


test_media_tags($mediatag, $expected)   X-Ref
Tests media tags.

param: string $mediatag HTML media tag
param: string $expected expected result

media_tags_provider()   X-Ref
Test cases for the test_media_tags test.


Class: but  - X-Ref

Class: but  - X-Ref