Commit graph

10 commits

Author SHA1 Message Date
Tim Starling
d36ea70309 Fix some PHPStorm inspections (#1)
* Triple backslash in regex should really be quadruple backslash
* Using the returned value of a void method
* Immediately overwritten array keys
* Duplicate array keys
* Foreach variable reuse
* sprintf() with too many params
* Incorrect reference usage

Change-Id: I3c649b543c9561a1614058c50f3847f663ff04df
2023-03-25 00:19:33 +00:00
Tim Starling
5e30a927bc tests: Make some PHPUnit data providers static
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.

Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.

Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
2023-03-24 02:53:57 +00:00
jenkins-bot
2e6f8c18e6 Merge "Language: Hard-deprecate Language::factory/getParentLanguage" 2023-03-10 17:03:37 +00:00
jenkins-bot
9213528d05 Merge "Remove deprecated Language::commafy and mw.language.commafy" 2023-03-10 16:56:06 +00:00
Fomafix
7f4e9bfa39 Remove deprecated Language::commafy and mw.language.commafy
Language::commafy and mw.language.commafy have been deprecated in
4bc5c761 included in MW 1.36.

Bug: T331708
Change-Id: I874c2c904fa4a7f04486113d1d92709c21d1f5bb
2023-03-10 15:16:06 +00:00
daniel
d19f30cede Tests: treat wgHooks like a regular config variable.
Prepare phpunit tests for a world where $wgHooks behaves like other
config variables: on-the-fly manipulation doesn't have an effect,
service objects need to be reset after changing it.

Change-Id: I34385f4c52febfe1c91bd7ea4100c06d1331adc8
2023-03-09 12:25:46 +11:00
Umherirrender
e6bd6d225e Language: Hard-deprecate Language::factory/getParentLanguage
- Language::getParentLanguage
- Language::factory

Bug: T325986
Change-Id: I0077630232587860ea4c7e37790cb24fc17f6e92
2023-03-02 23:18:27 +01:00
Umherirrender
0ccde3720d Language: Hard-deprecate language converter functions, deprecated in 1.35
These are:
- Language::getConverter()
- Language::autoConvert()
- Language::autoConvertToAllVariants()
- Language::convert()
- Language::convertNamespace()
- Language::convertHtml()
- Language::convertCategoryKey()
- Language::getVariants()
- Language::hasVariants()
- Language::hasVariant()
- Language::getDefaultVariant()
- Language::getURLVariant()
- Language::getExtraHashOptions()
- Language::getConvRuleTitle()

Bug: T252095
Change-Id: I810e90b43ba112b868821c811c51b5532800765f
2023-03-02 21:13:16 +00:00
DannyS712
a5293c323a Tests: add LanguageNameUtils to DummyServicesTrait
Returns a real LanguageNameUtils object configured as needed.

Change-Id: I50a8c6bc15665c454642a513f6669191456a3939
2023-02-02 20:50:48 +00:00
Umherirrender
9bcd6f7f80 tests: Move all language converter tests into /includes/
Move tests from /languages/ to /includes/language/ similiar to the
classes in f5644ba
Clean up suite config too not longer run that folder as test,
remove from coverage, there no php files to cover

Remove converter tests from Language*Test files,
all identical to the *ConverterTest cases (or remove the whole file)

Change-Id: I098ba241bd61d8ed2ee9b65393416077e3544e79
2023-02-01 20:10:56 +01:00
Renamed from tests/phpunit/languages/LanguageIntegrationTest.php (Browse further)