[tests] Add a regression test for Xml::input
`Xml::input` threw an exception with `wgUseMediaWikiUIEverywhere` true, when classes don't contain `cdx-text-input__input`. To avoid this regression from happening again, add a test for it. Bug: T341566 Change-Id: I862b36efd10e34a2538d3afa9d67b822f2383c58
This commit is contained in:
parent
fd688baad7
commit
ca6601b293
1 changed files with 15 additions and 0 deletions
|
|
@ -77,6 +77,21 @@ class XmlTest extends MediaWikiIntegrationTestCase {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Xml::input
|
||||||
|
* @covers Html::getTextInputAttributes
|
||||||
|
*/
|
||||||
|
public function testInputWithMWUIEverywhere() {
|
||||||
|
$this->overrideConfigValues( [
|
||||||
|
MainConfigNames::UseMediaWikiUIEverywhere => true,
|
||||||
|
] );
|
||||||
|
|
||||||
|
$this->assertSame(
|
||||||
|
'<input name="name" class="foo mw-ui-input" />',
|
||||||
|
Xml::input( 'name', false, false, [ 'class' => 'foo' ] )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function testOpenElement() {
|
public function testOpenElement() {
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'<element k="v">',
|
'<element k="v">',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue