Commit graph

6 commits

Author SHA1 Message Date
James D. Forrester
c1599c91b3 Namespace Config-related classes under \MediaWiki\Config
Bug: T166010
Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
2023-09-21 05:41:58 +00:00
James D. Forrester
a8a6cfd966 Namespace NamespaceInfo under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
2023-09-19 05:17:04 +00:00
Umherirrender
997726c4ee tests: Use array_fill_keys instead of array_combine/array_fill
Change-Id: I3bee4452b182a982b99017beed4ff929e96a10c6
2023-04-29 15:51:03 +02: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
thiemowmde
66b0d4fc45 Replace Config mocks with trivial HashConfig instances
The Hashconfig class is as trivial as it can be. No need to mock it
in these situations.

Change-Id: I09cd46b0ee2c84927f88cf4e40923b643100e528
2023-03-01 08:15:28 +01:00
C. Scott Ananian
508a2c1abe Accept a Bcp47Code object in LanguageFactory::getLanguage()
This is an efficient and safe downcast if the parameter is already
a Language object (since Language implements the Bcp47Code interface);
otherwise it does the appropriate conversion to a MediaWiki-internal
code and creates the appropriate language object.  Note that there
are some ambiguities in the internal codes, such that:
  LanguageFactory::getLanguage( 'egl' )->getCode() # returns 'egl'
while:
  Bcp47Code $bcp = new Bcp47CodeValue( 'egl' );
  LanguageFactory::getLanguage( $bcp )->getCode() # returns 'eml'

Change-Id: Iea158fc849964ba71a27363f9522b1b3bbb82aee
2023-01-30 20:06:38 -05:00