diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2024-02-05 13:59:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2024-02-05 13:59:51 +0000 |
commit | ee6040661798e68dbbcdd03e16c12dd1102d4fe7 (patch) | |
tree | a0000b2ada591570dce01772bf7e744a78bfc86d /tests | |
parent | 4842f12bb7007846a4d14ca2bafebf948045085e (diff) | |
parent | aa7eeeeef92c55c270f8b16bb5abbbd398c5e324 (diff) | |
download | mediawikicore-ee6040661798e68dbbcdd03e16c12dd1102d4fe7.tar.gz mediawikicore-ee6040661798e68dbbcdd03e16c12dd1102d4fe7.zip |
Merge "Remove uses of $wgUseMediaWikiUIEverywhere"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/phpunit/includes/Html/HtmlTest.php | 59 | ||||
-rw-r--r-- | tests/phpunit/includes/xml/XmlTest.php | 16 |
2 files changed, 0 insertions, 75 deletions
diff --git a/tests/phpunit/includes/Html/HtmlTest.php b/tests/phpunit/includes/Html/HtmlTest.php index d75165bfd7a1..574d1438000b 100644 --- a/tests/phpunit/includes/Html/HtmlTest.php +++ b/tests/phpunit/includes/Html/HtmlTest.php @@ -832,65 +832,6 @@ class HtmlTest extends MediaWikiIntegrationTestCase { $this->assertSame( $expected, $html ); } - /** @dataProvider provideGetTextInputAttributes */ - public function testGetTextInputAttributes( - bool $useMediaWikiUIEverywhere, - $classAttribute, - $expectedClassAttribute - ) { - $this->overrideConfigValue( MainConfigNames::UseMediaWikiUIEverywhere, $useMediaWikiUIEverywhere ); - $attrs = Html::getTextInputAttributes( [ 'class' => $classAttribute ] ); - $this->assertSame( $expectedClassAttribute, $attrs['class'] ); - } - - public static function provideGetTextInputAttributes(): iterable { - yield 'MWUI everywhere, non-codex, class string' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => 'foo', - 'expectedClassAttribute' => 'foo mw-ui-input', - ]; - yield 'MWUI everywhere, non-codex, class list' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => [ 'foo' ], - 'expectedClassAttribute' => [ 'foo', 'mw-ui-input' => true ], - ]; - yield 'MWUI everywhere, non-codex, class dict' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => [ 'foo' => true ], - 'expectedClassAttribute' => [ 'foo' => true, 'mw-ui-input' => true ], - ]; - yield 'MWUI everywhere, non-codex, class dict disables mw-ui-input' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => [ 'foo' => true, 'mw-ui-input' => false ], - 'expectedClassAttribute' => [ 'foo' => true, 'mw-ui-input' => true ], - ]; - yield 'MWUI everywhere, codex, class string' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => 'foo cdx-text-input__input', - 'expectedClassAttribute' => 'foo cdx-text-input__input', - ]; - yield 'MWUI everywhere, codex, class list' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => [ 'foo', 'cdx-text-input__input' ], - 'expectedClassAttribute' => [ 'foo', 'cdx-text-input__input' ], - ]; - yield 'MWUI everywhere, codex, class dict' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => [ 'foo' => true, 'cdx-text-input__input' => true ], - 'expectedClassAttribute' => [ 'foo' => true, 'cdx-text-input__input' => true ], - ]; - yield 'MWUI everywhere, class dict disables codex' => [ - 'useMediaWikiUIEverywhere' => true, - 'classAttribute' => [ 'foo' => true, 'cdx-text-input__input' => false ], - 'expectedClassAttribute' => [ 'foo' => true, 'cdx-text-input__input' => false, 'mw-ui-input' => true ], - ]; - yield 'not MWUI everywhere' => [ - 'useMediaWikiUIEverywhere' => false, - 'classAttribute' => 'foo', - 'expectedClassAttribute' => 'foo', - ]; - } - public static function provideEncodeJsVar() { // $expected, $input yield 'boolean' => [ 'true', true ]; diff --git a/tests/phpunit/includes/xml/XmlTest.php b/tests/phpunit/includes/xml/XmlTest.php index 3ef708ad9f62..ebb53b4e1fe1 100644 --- a/tests/phpunit/includes/xml/XmlTest.php +++ b/tests/phpunit/includes/xml/XmlTest.php @@ -15,7 +15,6 @@ class XmlTest extends MediaWikiIntegrationTestCase { $this->overrideConfigValues( [ MainConfigNames::LanguageCode => 'en', - MainConfigNames::UseMediaWikiUIEverywhere => false, ] ); $langObj = $this->getServiceContainer()->getLanguageFactory()->getLanguage( 'en' ); @@ -77,21 +76,6 @@ class XmlTest extends MediaWikiIntegrationTestCase { ); } - /** - * @covers Xml::input - * @covers \MediaWiki\Html\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() { $this->assertEquals( '<element k="v">', |