Commit graph

16 commits

Author SHA1 Message Date
James D. Forrester
bc662aec9b Move Language and friends into Language namespace
Bug: T353458
Change-Id: Id3202c0c4f4a2043bf97b7caee081acab684155c
2024-08-10 13:36:30 +02:00
Umherirrender
b4e0d31644 tests: Use namespaced classes (@covers)
Some fixes done via codesniffer fix (Ibd0f48e14e)

Change-Id: I0404ceca7c5abe8d32ef9a8fce404c7b89ffbaae
2024-06-14 00:15:40 +02:00
Reedy
85396a9c99 tests: Fix @covers and @coversDefaultClass to have leading \
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
2024-02-16 22:43:56 +00:00
James D. Forrester
4bae64d1c7 Namespace includes/context
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
2024-02-08 11:07:01 -05:00
Martin Urbanec
6ec01553c5 Move StaticUserOptionsLookup to the MediaWiki\User\Options namespace
Follow-up to I9822eb1553870b876d0b8a927e4e86c27d83bd52,
I missed the Static class in that patch.

Bug: T352284
Change-Id: I42653491c19dde5de99e0661770e2c81df5d7e84
2023-11-29 14:08:40 -05:00
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
1d0b7ae1e2 Namespace User under \MediaWiki\User
Bug: T166010
Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
2023-09-19 19:18:16 +00:00
Wandji69
ca4cb02e4c context: Disallow cloning RequestContext object and throw an error
Bug: T323187
Change-Id: Ib4a1e97d7ab9f91b937e099394ccd9a2d37a841b
2023-09-14 22:09:35 +00:00
Amir Sarabadani
d8e542abf9 Reorg: Move three output related classes to includes/Output/
And namesapce them:
 - StreamFile
 - OutputHandler
 - OutputPage

Bug: T321882
Change-Id: Iedf8d88c595e580f2d8f0734c92aa5c45618ba33
2023-09-05 19:36:42 +01:00
Tim Starling
5c6bb65c1c Normalize the skin name when "skin" is in HiddenPrefs
When $wgHiddenPrefs['skin'] = true and $wgDefaultSkin is set to a
nonexistent skin, SkinFallback should be used. An exception should not
be thrown.

An odd case, but it did work before a99e31533b.

Add test. Simplify the existing tests, using StaticUserOptionsLookup
instead of the mock builder.

Bug: T342733
Change-Id: I372ace56c104a3ecc9c02d87524e8ef0be7239cf
2023-07-27 10:17:13 +10:00
Tim Starling
fc91c94dff Regression test for T342733 empty skin name
Bug: T342733
Change-Id: Ia5076b917e085442340d90256116890d52bfe6de
2023-07-26 23:12:14 +10:00
Tim Starling
e41e755d7b Add tests for RequestContext::getSkin()
Change-Id: I702697bfb3a55f613cf311700733e35fb20d6dea
2023-07-11 12:06:26 +10: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
James D. Forrester
ad06527fb4 Reorg: Namespace the Title class
This is moderately messy.

Process was principally:

* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
  xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
  xargs rg --files-with-matches 'Title\b' | \
  xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix

Then manual fix-ups for a few files that don't have any use statements.

Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
2023-03-02 08:46:53 -05:00
James D. Forrester
f9476b595e tests: Consolidate legacy Context tests into integration suite
None of these are stand-alone unit tests.

Change-Id: I5b48cffd000a0f758bc7a24b07cebb30b68fde01
2023-01-17 10:08:39 -05:00
James D. Forrester
b980122413 tests: Add some basic coverage for RequestContext::sanitizeLangCode
Change-Id: If8fa4e6fe1428d25d6197b77d5ed192b2940cf7c
2022-11-02 12:20:47 -04:00