testRemovehtmltagsOnHtml5Tags needs wgUseTidy = false;
3) SanitizerTest::testRemovehtmltagsOnHtml5Tags with data set #2
('time', false)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<time></time>
-'
+'<time>'
Change-Id: Ib7e156293e2efae053b055e40393e442719eb5bd
* @param Boolean $escaped Wheter sanitizer let the tag in or escape it (ie: '<video>')
*/
function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) {
- global $wgHtml5;
-
- # Enable HTML5 mode
- $save = $wgHtml5;
- $wgHtml5 = true;
+ $this->setMwGlobals( array(
+ # Enable HTML5 mode
+ 'wgHtml5' => true,
+ 'wgUseTidy' => false
+ ));
if( $escaped ) {
$this->assertEquals( "<$tag>",
Sanitizer::removeHTMLtags( "<$tag>" )
);
}
- $wgHtml5 = $save;
}
/**
}
function testSelfClosingTag() {
- $GLOBALS['wgUseTidy'] = false;
+ $this->setMwGlobals( array(
+ 'wgUseTidy' => false
+ ));
+
$this->assertEquals(
'<div>Hello world</div>',
Sanitizer::removeHTMLtags( '<div>Hello world</div />' ),