[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:
Martin Urbanec 2023-07-11 17:09:20 +02:00
parent fd688baad7
commit ca6601b293

View file

@ -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">',