}
public function testElementBasics() {
- global $wgWellFormedXml;
-
$this->assertEquals(
'<img>',
Html::element( 'img', null, '' ),
'Close tag for empty element (array, string)'
);
- $wgWellFormedXml = true;
+ $this->setMwGlobals( 'wgWellFormedXml', true );
$this->assertEquals(
'<img />',
}
public function testExpandAttributesForBooleans() {
- global $wgHtml5, $wgWellFormedXml;
-
$this->assertEquals(
'',
Html::expandAttributes( array( 'selected' => false ) ),
'Boolean attributes have no value when value is true (passed as numerical array)'
);
- $wgWellFormedXml = true;
+ $this->setMwGlobals( 'wgWellFormedXml', true );
$this->assertEquals(
' selected=""',
'Boolean attributes have empty string value when value is true (wgWellFormedXml)'
);
- $wgHtml5 = false;
+ $this->setMwGlobals( 'wgHtml5', false );
$this->assertEquals(
' selected="selected"',
* Please note it output a string prefixed with a space!
*/
public function testExpandAttributesVariousExpansions() {
- global $wgWellFormedXml;
-
### NOT EMPTY ####
$this->assertEquals(
' empty_string=""',
'Number 0 value needs no quotes'
);
- $wgWellFormedXml = true;
+ $this->setMwGlobals( 'wgWellFormedXml', true );
$this->assertEquals(
' empty_string=""',