parent::tearDown();
}
+ /**
+ * @expectedException PHPUnit_Framework_Error_Notice
+ * @expectedExceptionMessage given element name with space
+ * @covers Html::openElement
+ */
+ public function testOpenElement() {
+ Html::openElement( 'span id="x"' );
+ }
+
/**
* @covers Html::element
* @covers Html::rawElement
}
/**
- * Test for Html::expandAttributes()
* Please note it output a string prefixed with a space!
* @covers Html::expandAttributes
*/
/**
* How do we handle duplicate keys in HTML attributes expansion?
- * We could pass a "class" the values: 'GREEN' and array( 'GREEN' => false )
+ * We could pass a "class" the values: 'GREEN' and [ 'GREEN' => false ]
* The latter will take precedence.
*
* Feature added by r96188
),
'Namespace selector namespace filtering.'
);
+ $this->assertEquals(
+ '<select id="namespace" name="namespace">' . "\n" .
+ '<option value="" selected="">todos</option>' . "\n" .
+ '<option value="2">User</option>' . "\n" .
+ '<option value="4">MyWiki</option>' . "\n" .
+ '<option value="5">MyWiki Talk</option>' . "\n" .
+ '<option value="6">File</option>' . "\n" .
+ '<option value="7">File talk</option>' . "\n" .
+ '<option value="8">MediaWiki</option>' . "\n" .
+ '<option value="9">MediaWiki talk</option>' . "\n" .
+ '<option value="10">Template</option>' . "\n" .
+ '<option value="11">Template talk</option>' . "\n" .
+ '<option value="14">Category</option>' . "\n" .
+ '<option value="15">Category talk</option>' . "\n" .
+ '</select>',
+ Html::namespaceSelector(
+ [ 'exclude' => [ 0, 1, 3, 100, 101 ], 'all' => '' ]
+ ),
+ 'Namespace selector namespace filtering with empty custom "all" option.'
+ );
}
/**