Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Class: medialib_test  - X-Ref

Test classes for handling embedded media (audio/video).

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


pretend_to_be_safari()   X-Ref
Sets user agent to Safari.


pretend_to_be_firefox()   X-Ref
Sets user agent to Firefox.


test_get_filename()   X-Ref
Test for core_media::get_filename.


test_get_extension()   X-Ref
Test for core_media::get_extension.


test_list_supported_urls()   X-Ref
Test for the core_media_player list_supported_urls.


test_get_players()   X-Ref
Test for get_players


test_can_embed_url()   X-Ref
Test for can_embed_url


test_embed_url_fallbacks()   X-Ref
Test for embed_url.
Checks multiple format/fallback support.


test_embed_url_swf()   X-Ref
Test for embed_url.
Check SWF works including the special option required to enable it


test_slash_arguments()   X-Ref
Same as test_embed_url MP3 test, but for slash arguments.


test_embed_or_blank()   X-Ref
Test for embed_url.
Checks the EMBED_OR_BLANK option.


test_embed_url_size()   X-Ref
Test for embed_url.
Checks that size is passed through correctly to player objects and tests
size support in html5video output.


test_embed_url_name()   X-Ref
Test for embed_url.
Checks that name is passed through correctly to player objects and tests
name support in html5video output.


test_split_alternatives()   X-Ref
Test for split_alternatives.


test_embed_alternatives()   X-Ref
Test for embed_alternatives (with multiple urls)


test_initialise()   X-Ref
Make sure the instance() method returns singleton for the same page and different object for another page


get_players_test($manager)   X-Ref
Access list of players as string, shortening it by getting rid of
repeated text.

param: core_media_manager $manager The core_media_manager instance
return: string Comma-separated list of players