Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400]

Test classes for handling embedded media.

Copyright: 2016 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 356 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: player_test  - X-Ref

Test script for media embedding.

setUp()   X-Ref
Pre-test setup. Preserves $CFG.


test_is_installed()   X-Ref
Test that plugin is returned as enabled media plugin.


test_supported_extensions()   X-Ref
Test method get_supported_extensions()


test_embed_url()   X-Ref
Test embedding without media filter (for example for displaying file resorce).


test_embed_link()   X-Ref
Test that mediaplugin filter replaces a link to the supported file with media tag.

filter_mediaplugin is enabled by default.

test_fallback()   X-Ref
Test that only supported URLs are listed as sources but all URLs are present in links fallbacks.


test_prevent_other_players()   X-Ref
Assert other players do not apply after videojs was applied.


test_embed_media()   X-Ref
Test that mediaplugin filter adds player code on top of <video> tags.

filter_mediaplugin is enabled by default.

youtube_plugin_engaged($t)   X-Ref
Helper function for testing youtube videos embedding.

param: string $t output of core_media_manager::embed_url.

test_youtube()   X-Ref
Test that VideoJS can embed youtube videos.


youtube_start_time_provider()   X-Ref
Data provider for {@see test_youtube_start_time}

return: array

test_youtube_start_time(string $url, int $expectedstart)   X-Ref
Test Youtube video embedding with URL's containing start time interval

param: string $url
param: int $expectedstart

flash_plugin_engaged($t)   X-Ref
Helper function for testing flash videos embedding.

param: string $t output of core_media_manager::embed_url.

test_flash_behaviour()   X-Ref
Test that VideoJS can not embed flash videos.


test_rtmp_behaviour()   X-Ref
Test that VideoJS can not embed RTMP streams.