Commit graph

117594 commits

Author SHA1 Message Date
Eric Gardner
a0766a8ac7 Update OOUI from 0.47.4 to 0.47.5
Release notes: https://gerrit.wikimedia.org/g/oojs/ui/+/v0.47.5/History.md

Depends-On: Ia581f44ca0f147b318ce59b7271e4106d930ac3f
Change-Id: Ia6819baf32b93bbe67245709d4d9e5ef1358b22c
2023-07-19 14:51:07 -07:00
Umherirrender
b42062e7d0 tests/parser: Use LinkTarget in ParserTestRunner
Replace Title with LinkTarget/PageReference

Change-Id: Ia0e7cfafc680ea881539aed772bf10ee1b610f4c
2023-07-18 20:58:24 +02:00
jenkins-bot
bb40716bda Merge "tests: Change expectDeprecation to expectDeprecationAndContinue" 2023-07-18 18:43:24 +00:00
babiola
997d5e3c1e Title: The Title::getSubjectPage() method is deprecated from version 1.34 and all places that call it should use the NamespaceInfo::getSubjectPage method instead.
Bug: T338956
Change-Id: I0dabce859daeebcd9ccf1daeeae8310aafb0985f
2023-07-18 18:00:38 +00:00
jenkins-bot
0c333eb4cd Merge "mediawiki.page.watch.ajax: Use Object.create( null ) instead of {}" 2023-07-18 17:16:44 +00:00
Umherirrender
0099099bb0 tests: Change expectDeprecation to expectDeprecationAndContinue
TestCase::expectDeprecation() is deprecated in PHPUnit 10,
use mediawiki own MediaWikiTestCaseTrait::expectDeprecationAndContinue()
for this case. This avoids the trigger_error call and isolate the
deprecation check into MWDebug class.

The continue part is also helpful in StubGlobalUserTest, where after the
first deprecation access more code exists, that was not executed as
PhpUnit 9 converts deprecations to exceptions.
In RCFeedTest the exception needs to be catched as the code proceed
after the deprecation notice is emitted.

Bug: T342110
Change-Id: Iecf827bec0d5215fd21bbb20b84caf928ee108a0
2023-07-18 16:35:43 +00:00
Fomafix
5a95986521 mediawiki.page.watch.ajax: Use Object.create( null ) instead of {}
The object watchstarsByTitle contains page titles as keys.
A normal object created by {} has some properties like hasOwnProperty.
This leads to problems if the page title has such a name like on
  https://en.wiktionary.org/wiki/hasOwnProperty
This title with lower case letter is valid on the configuration:
  $wgCapitalLinkOverrides[ NS_MAIN ] = false;
An object created by Object.create( null ) has no predefined
properties.

Bug: T342137
Change-Id: Id30b1918b0ddbc3f4abfb3b200168323d5d1bf21
2023-07-18 15:54:25 +00:00
jenkins-bot
c236cd6c0f Merge "ResourceLoader: Simplify and clean up ClientHtml nonce passing" 2023-07-18 15:01:53 +00:00
DannyS712
9c30021328 ResourceLoader: Simplify and clean up ClientHtml nonce passing
remove $nonce parameter from ::getLoad(), access
the option directly in that method; unhoist variables
and reduce duplication.

Change-Id: If0aef56fa123105e5c98568cb95c09368d55b68e
2023-07-18 15:35:50 +01:00
jenkins-bot
9b7f7dba4c Merge "Slot diff option "contentLanguage" should be a string" 2023-07-18 12:24:09 +00:00
Tim Starling
cbeceb1ae3 Slot diff option "contentLanguage" should be a string
Quick fix for production error.

Bug: T342099
Bug: T341961
Change-Id: Ifab76ab7018ee1498851223e1181b527d506efbb
2023-07-18 21:56:11 +10:00
jenkins-bot
a2289ef5a4 Merge "rdbms: Build generalized SQL while building the main SQL in UPDATE" 2023-07-18 09:06:38 +00:00
jenkins-bot
49082b6a80 Merge "tests: Change some setMwGlobals to overrideConfigValue" 2023-07-18 08:37:06 +00:00
Translation updater bot
50f7a00117 Localisation updates from https://translatewiki.net.
Change-Id: I7ae1df51bcf05c094885a42c5456e45a77fea3a7
2023-07-18 09:31:25 +02:00
Bartosz Dziewoński
1b825c1505 TempUserCreator: Change getStashedNameOrPlaceholder() to just getStashedName()
I found myself needing to just get the stashes name without the
placeholder for T331397, and I thought that this seems like a weird
API. The caller should get the placeholder separately if desired,
which is easy to do in all of the current callers.

Follow-up to 65f04c763a.

Change-Id: Icf1d24f17b60a461ef682bc5da01be6ebc3a2d93
2023-07-18 02:30:08 +02:00
James D. Forrester
c2cdc8eebf RawAction: Allow non-TextContent Contents to support action=raw if they want
Change-Id: I24f8ee5742f77cf203e7c237c5fedb12de1ccdcb
2023-07-17 23:29:18 +00:00
Umherirrender
d2a09384a7 tests: Change some setMwGlobals to overrideConfigValue
Change-Id: I21b9bf907e313947360b1607f11ae9917488f109
2023-07-17 23:02:32 +02:00
Fomafix
458d319798 LanguageIntegrationTest: Replace call of deprecated Language::factory
Only update test cases that tests non-deprecated functions.
Test cases that tests deprecated functions can be removed together with
the removal of the deprecated functions.

Also consistently use
  $this->getServiceContainer()
instead of
  MediaWikiServices::getInstance()

Change-Id: Iac40d6c66a31dd699ab8771244c701232e4354e8
2023-07-17 18:59:56 +00:00
jenkins-bot
6853d8b390 Merge "tests: Migrate Database::select usages to SelectQueryBuilder" 2023-07-17 14:45:48 +00:00
jenkins-bot
c8afcf1064 Merge "Title: Switch Database::select calls to SelectQueryBuilder" 2023-07-17 14:36:07 +00:00
jenkins-bot
1dc8713eb1 Merge "phpunit: Throw exception when MediaWikiServices is accessed too early" 2023-07-17 14:34:30 +00:00
jenkins-bot
13e3d16ea7 Merge "MediaWikiTest: avoid leaking values into the global state" 2023-07-17 13:39:48 +00:00
jenkins-bot
d5044833a5 Merge "Make ApiStashEditTest work if temp users are enabled" 2023-07-17 13:38:40 +00:00
jenkins-bot
3224aa1bf3 Merge "wdio-mediawiki: Upgrade mwbot from 2.0.0 to 2.1.3" 2023-07-17 13:20:29 +00:00
Amir Sarabadani
e7dcb3802e tests: Migrate Database::select usages to SelectQueryBuilder
Bug: T311866
Change-Id: I0324919f4e40f4e2db3dab1e9aacf74177170b20
2023-07-17 14:24:30 +02:00
Amir Sarabadani
a711c35634 Title: Switch Database::select calls to SelectQueryBuilder
Bug: T311866
Change-Id: I913a6181a5c3e03a7664f86e42e5926766ae19c4
2023-07-17 14:24:05 +02:00
Daimona Eaytoy
1c1bd76f52 phpunit: Delete DummyExtensionsTest
A code comment says that this code is necessary to avoid warnings like
"No tests in class ...", but I wasn't able to reproduce the warning in
question.

This code was added in https://w.wiki/73Wv, in 2010. I guess PHPUnit
might have changed enough over the last 13 years to no longer emit this
warning.

A quick look at the TestSuite class suggests that the warning is not
emitted when the constructor is called with a string, which is what
we're doing.

Things might change in PHPUnit 10, but TestSuite::__construct was made
private, so I think we may have to rewrite our suites anyway.

Change-Id: Ie044900ffcffca9c8f0d96b425271a2eda90a5cd
2023-07-17 12:16:27 +00:00
Daimona Eaytoy
6dfa6d451f phpunit: Throw exception when MediaWikiServices is accessed too early
Promote the deprecation to an error in the context of PHPUnit tests. The
point of hard deprecations is to make tests fail and this will help with
that, and also with eventually promoting the deprecation to an error
outside of tests.

Adjust code in parser tests that was accessing MediaWikiServices via
Title too early.

Avoid hack of resetting the error handler after loading Setup.php, and
conditionally install MW's hadler instead. This is particularly
important in scenarios where an exception is thrown before the handler
is reset, because MW's exception handler may also access
MediaWikiServices.

Bug: T227900
Bug: T273261
Change-Id: I7c5234046379cf4abd25d65e78c0a99ac9f32600
2023-07-17 12:16:14 +00:00
jenkins-bot
a5951b5f8f Merge "Correct defaultsort translation in Nepali" 2023-07-17 09:17:08 +00:00
Bada Kaji
85522d0b27 Correct defaultsort translation in Nepali
Change-Id: Ide38585c4c60ffdb4f3c254c37ab1362a61396af
2023-07-17 08:34:30 +00:00
Translation updater bot
a1e13ff06d Localisation updates from https://translatewiki.net.
Change-Id: Iaa58953c169dfc3a3e066410683e80ba00f49ad6
2023-07-17 08:18:21 +00:00
jenkins-bot
b34939c6e4 Merge "Inject extension namespaces into NamespaceInfo" 2023-07-17 04:38:34 +00:00
jenkins-bot
d00687831f Merge "phpunit: Introduce TypeDefUnitTestCase" 2023-07-17 04:38:27 +00:00
jenkins-bot
c943ebf8db Merge "OutputPageTest: specify required config value" 2023-07-16 20:59:19 +00:00
jenkins-bot
2239938e64 Merge "ApiBlockTest: improve permission checks" 2023-07-16 20:58:26 +00:00
jenkins-bot
43498b96fc Merge "CoreParserFunctionsTest: Avoid username pattern reserved for temp users" 2023-07-16 20:58:19 +00:00
jenkins-bot
419a4ed2d4 Merge "AuthManagerTest: Use localhost instead of local.wmftest.net" 2023-07-16 20:55:55 +00:00
Daimona Eaytoy
0e55aa602a Inject extension namespaces into NamespaceInfo
The service was previously accessing the global ExtensionRegistry
singleton, making it lose its statelessness. Dependencies should always
be injected, so add constructor parameters for that.

Simplify tests accordingly.

Change-Id: Iae375a81cab411fab607cba0addb2088131b3c81
2023-07-16 22:53:26 +02:00
Daimona Eaytoy
3b8efa44d2 MediaWikiTest: avoid leaking values into the global state
The MediaWiki class is the quintessence of global state. I'm not even
sure if it's safe to run this test together with others. At any rate,
avoid using RequestContext::getMain(), given that the context is passed
in explicitly. And also reset global $wgTitle after the test, or any
value set in this test may persist forever.

Bug: T341951
Change-Id: I1a94c6ca2f335ee5a2d7d57df6dc46b65ca1f767
2023-07-16 22:45:50 +02:00
Daimona Eaytoy
2d9b8797ef AuthManagerTest: Use localhost instead of local.wmftest.net
AIUI, the latter is vagrant-specific and doesn't work e.g. in
MediaWiki-Docker.

Change-Id: I63891b6796dbaeab63e7f34b1fddfafa5106fd1f
2023-07-16 20:26:22 +02:00
Daimona Eaytoy
6c7fa50a22 ApiBlockTest: improve permission checks
Do not assume that sysops don't have the hideuser right. That can be
changed in configuration. For instance, I have that in my local. Use an
appropriate authority without the 'hideuser' permission instead.

Also avoid overriding $wgGroupPermissions, and use an Authority instead.

Change-Id: I1c8b25965e41a1a0308dfbe0212c1c19deccb364
2023-07-16 20:14:22 +02:00
Daimona Eaytoy
5035ecd2f7 CoreParserFunctionsTest: Avoid username pattern reserved for temp users
The leading "*" is currently used as the username pattern for temp
users, meaning this test will fail if

  $wgAutoCreateTempUser['enabled'] = true;

Put the star at the end instead, and use a variable for the username
instead of repeating it multiple times.

Change-Id: Ie0414de5f9d9054dfec540f14bd0dc9ec7b4cb72
2023-07-16 19:55:50 +02:00
Winston Sung
64c005972c Merge zh and zh-tw namespace translations back to zh-hans, zh-hant,
zh-hk respectively

* Merge zh-tw translations back to zh-hant
* Split zh-hans, zh-hant, zh-hk translations and aliases from zh to
  respective message files
* Language->getNamespaceAliases() with the updated language fallback
  chain can already fetch aliases from language variant i18n files

All translation authors are added when merging those translations.

Bug: T286291
Bug: T296188
Change-Id: Ia2aa17fa15fe6d6b9396bf06b472d28b3ab12f68
2023-07-16 16:27:07 +00:00
Daimona Eaytoy
7e4969373e Make ApiStashEditTest work if temp users are enabled
- Avoid huge hack in doStashOld by just faking the time, so that we
  don't have to mess with the cache key.
- Disable temp users explicitly in tests that test anons.
- Add a TODO that the class should be expanded to test both scenarios
  (temps and anons).

Bug: T341949
Change-Id: I1317be62b69e4cf6759012e6ea7d9c92c46765f4
2023-07-16 16:22:27 +02:00
Daimona Eaytoy
1acfd7c45f OutputPageTest: specify required config value
This test assumes that the CachePages config setting is true, but that
may not be the case. The test already takes a config array, so we can
simply add the expected value there.

Also simplify the code a little bit with the `??=` operator.

Change-Id: Iecd5e3f5c83bab87aad666ef334cd692ee3a2c41
2023-07-16 15:19:58 +02:00
Amir E. Aharoni
fbcc0eb52d Mention change of Buginese main page name in Release notes
Bug: T341943
Change-Id: I2d176eae812ec70b352fcec31042b8ab754be664
2023-07-16 15:59:49 +03:00
Amir E. Aharoni
0a37637d13 Update autonym for Buginese
Bug: T341942
Change-Id: I1470d65a61d9a65d41681d4a6a49a1d78b399b0a
2023-07-16 15:41:51 +03:00
jenkins-bot
a98f83cb3a Merge "mediawiki.user: Validate the cookie in sessionId() before returning" 2023-07-16 09:27:57 +00:00
jenkins-bot
d38b0e11ef Merge "tests: Pass Title to editPage() when already parsed" 2023-07-16 09:10:27 +00:00
Taavi Väänänen
bca86887cb
ExtensionJsonTestBase: add session provider tests
Depends-On: I28776e62017c680c11f97363540c1192f6c8932f
Change-Id: I85a2df9bdbfa500756a625b11d1ad3d3e71b8b32
2023-07-15 19:26:33 +03:00