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] [Versions 39 and 310]

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

Copyright: 2012 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 499 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/tests/fixtures/testable_core_media_player.php

Defines 1 class


Class: core_medialib_testcase  - X-Ref

Test script for media embedding.

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