Skip to content

Commit 5566fff

Browse files
committed
[#47] Fix tests by ignoring deprecation debugging messages
1 parent 44219ce commit 5566fff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/filter_test.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function test_videojs_enabled_true(): void {
6464
$this->resetAfterTest(true);
6565

6666
$filterplugin = new text_filter(null, []);
67+
$this->resetDebugging();
6768

6869
// We're testing a private method, so we need to setup reflector magic.
6970
$method = new ReflectionMethod('\filter_smartmedia\text_filter', 'videojs_enabled');
@@ -83,6 +84,7 @@ public function test_videojs_enabled_false(): void {
8384
media::set_enabled_plugins('html5video');
8485

8586
$filterplugin = new text_filter(null, []);
87+
$this->resetDebugging();
8688

8789
// We're testing a private method, so we need to setup reflector magic.
8890
$method = new ReflectionMethod('\filter_smartmedia\text_filter', 'videojs_enabled');
@@ -99,6 +101,7 @@ public function test_videojs_enabled_false(): void {
99101
public function test_get_smart_elements_no_smart(): void {
100102
$this->resetAfterTest(true);
101103
$filterplugin = new text_filter(null, []);
104+
$this->resetDebugging();
102105

103106
$linkhref = 'http://moodle.local/pluginfile.php/1461/mod_label/intro/SampleVideo1mb.mp4';
104107

@@ -114,6 +117,7 @@ public function test_get_smart_elements_no_smart(): void {
114117
public function test_get_embed_markup_simple(): void {
115118
$this->resetAfterTest(true);
116119
$filterplugin = new text_filter(null, []);
120+
$this->resetDebugging();
117121

118122
$linkhref = 'http://moodle.local/pluginfile.php/1461/mod_label/intro/OriginalVideo.mp4';
119123
$urls = [new url('http://moodle.local/pluginfile.php/1461/mod_label/intro/SampleVideo1mb.m3u8')];
@@ -145,7 +149,9 @@ public function test_get_embed_markup_simple(): void {
145149
public function test_text_filter_filter_no_replace(): void {
146150
$this->resetAfterTest(true);
147151
$filterplugin = new text_filter(null, []);
152+
$this->resetDebugging();
148153

154+
$this->resetDebugging();
149155
$inputtext = '<div class="no-overflow">'
150156
.'<a href="#">Some test data</a>'
151157
.'<a href="#">Some other test data</a>'
@@ -163,6 +169,7 @@ public function test_get_placeholder_markkup(): void {
163169

164170
global $DB;
165171
$filterplugin = new text_filter(null, []);
172+
$this->resetDebugging();
166173

167174
$linkhref = 'http://moodle.local/pluginfile.php/1461/mod_label/intro/SampleVideo1mb.avi';
168175
$fulltext = '<div class="no-overflow">'
@@ -515,6 +522,7 @@ public function test_filter_replace($text, $regex, $matchcount, $mediaplugincoun
515522
$PAGE->set_url(new url($pageurl));
516523

517524
$filterplugin = new text_filter(null, [], $conversion);
525+
$this->resetDebugging();
518526
$result = $filterplugin->filter($text);
519527
$this->assertEquals($matchcount, preg_match_all($regex, $result));
520528

@@ -546,6 +554,7 @@ public function test_view_source(): void {
546554
$PAGE->set_url(new url("/my/"));
547555

548556
$filterplugin = new text_filter(null, [], $conversion);
557+
$this->resetDebugging();
549558
$text = '<div><div><video><source src="url.com/pluginfile.php/fake.mp4"/></video></div></div>';
550559
$result = $filterplugin->filter($text);
551560
$this->assertMatchesRegularExpression('/<button.*View source media.*<\/button>/', $result);
@@ -571,6 +580,7 @@ public function test_view_optimised(): void {
571580
$SESSION->local_smartmedia_viewsource = [sha1('url.com/pluginfile.php/fake.mp4') => true];
572581

573582
$filterplugin = new text_filter(null, [], $conversion);
583+
$this->resetDebugging();
574584
$result = $filterplugin->filter($text);
575585
$this->assertMatchesRegularExpression('/<button.*View optimised media.*<\/button>/', $result);
576586
}

0 commit comments

Comments
 (0)