Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 45... Línea 45...
45
    }
45
    }
Línea 46... Línea 46...
46
 
46
 
47
    /**
47
    /**
48
     * Test that plugin is returned as enabled media plugin.
48
     * Test that plugin is returned as enabled media plugin.
49
     */
49
     */
50
    public function test_is_installed() {
50
    public function test_is_installed(): void {
51
        $sortorder = \core\plugininfo\media::get_enabled_plugins();
51
        $sortorder = \core\plugininfo\media::get_enabled_plugins();
52
        $this->assertEquals(['html5audio' => 'html5audio'], $sortorder);
52
        $this->assertEquals(['html5audio' => 'html5audio'], $sortorder);
Línea 53... Línea 53...
53
    }
53
    }
54
 
54
 
55
    /**
55
    /**
56
     * Test method get_supported_extensions()
56
     * Test method get_supported_extensions()
57
     */
57
     */
58
    public function test_get_supported_extensions() {
58
    public function test_get_supported_extensions(): void {
Línea 59... Línea 59...
59
        global $CFG;
59
        global $CFG;
Línea 68... Línea 68...
68
    }
68
    }
Línea 69... Línea 69...
69
 
69
 
70
    /**
70
    /**
71
     * Test method list_supported_urls()
71
     * Test method list_supported_urls()
72
     */
72
     */
73
    public function test_list_supported_urls() {
73
    public function test_list_supported_urls(): void {
74
        global $CFG;
74
        global $CFG;
Línea 75... Línea 75...
75
        require_once($CFG->libdir . '/filelib.php');
75
        require_once($CFG->libdir . '/filelib.php');
Línea 87... Línea 87...
87
    }
87
    }
Línea 88... Línea 88...
88
 
88
 
89
    /**
89
    /**
90
     * Test embedding without media filter (for example for displaying file resorce).
90
     * Test embedding without media filter (for example for displaying file resorce).
91
     */
91
     */
92
    public function test_embed_url() {
92
    public function test_embed_url(): void {
Línea 93... Línea 93...
93
        global $CFG;
93
        global $CFG;
Línea 94... Línea 94...
94
 
94
 
Línea 118... Línea 118...
118
    /**
118
    /**
119
     * Test that mediaplugin filter replaces a link to the supported file with media tag.
119
     * Test that mediaplugin filter replaces a link to the supported file with media tag.
120
     *
120
     *
121
     * filter_mediaplugin is enabled by default.
121
     * filter_mediaplugin is enabled by default.
122
     */
122
     */
123
    public function test_embed_link() {
123
    public function test_embed_link(): void {
124
        $url = new \moodle_url('http://example.org/some_filename.wav');
124
        $url = new \moodle_url('http://example.org/some_filename.wav');
125
        $text = \html_writer::link($url, 'Watch this one');
125
        $text = \html_writer::link($url, 'Watch this one');
126
        $content = format_text($text, FORMAT_HTML);
126
        $content = format_text($text, FORMAT_HTML);
Línea 127... Línea 127...
127
 
127
 
Línea 132... Línea 132...
132
    }
132
    }
Línea 133... Línea 133...
133
 
133
 
134
    /**
134
    /**
135
     * Test that mediaplugin filter does not work on <audio> tags.
135
     * Test that mediaplugin filter does not work on <audio> tags.
136
     */
136
     */
137
    public function test_embed_media() {
137
    public function test_embed_media(): void {
138
        $url = new \moodle_url('http://example.org/some_filename.wav');
138
        $url = new \moodle_url('http://example.org/some_filename.wav');
139
        $trackurl = new \moodle_url('http://example.org/some_filename.vtt');
139
        $trackurl = new \moodle_url('http://example.org/some_filename.vtt');
140
        $text = '<audio controls="true"><source src="'.$url.'"/><source src="somethinginvalid"/>' .
140
        $text = '<audio controls="true"><source src="'.$url.'"/><source src="somethinginvalid"/>' .
141
            '<track src="'.$trackurl.'">Unsupported text</audio>';
141
            '<track src="'.$trackurl.'">Unsupported text</audio>';