Commit graph

30 commits

Author SHA1 Message Date
Andre Klapper 4da4dad97b Use explicit nullable type on parameter arguments (for PHP 8.4)
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.

Bug: T376276
Change-Id: I251cb37401c37242f493816b6f70ab61a64a4c32
2024-10-26 15:05:13 +02:00
Umherirrender 7e5eceb5a6 Use namespaced classes
Changes to the use statements done automatically via script

Change-Id: Iab065a2005acccfe05cc827fdafc7861687d053d
2024-10-20 00:55:03 +02:00
Umherirrender a51c944567 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I3d7a1ffe167b69d3f4ce51d0c248c758e1cdd70c
2024-06-12 20:31:47 +02:00
Umherirrender aa41e1e292 Migrate to IDatabase::newInsertQueryBuilder/newUpdateQueryBuilder
UpdateQueryBuilder does not return a value,
removed the return value from the functions as well,
deprecated since 1.33

Change-Id: I3b934a5e6d5a53c07ec5233da00d9f53ba7bae92
2024-04-13 22:51:32 +02:00
Sergio Gimeno 152db8a06f Replace deprecated usage of wfGetDB
Bug: T330641
Change-Id: I863dc67e3196ea20c4f6145c5d3bb68b445b5195
2024-02-13 20:22:33 +01:00
Novem Linguae c71d826ede Remove $this->tablesUsed from PHPUnit tests
Deprecated in T342301 in v1.41. This is now tracked
automatically. The variable can be safely deleted.

Change-Id: I3864ee85e8b0ff74385eee88018a37f61927f5ef
2024-01-14 04:48:27 -08:00
Umherirrender a0ca1d89c6 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statements done manually

Change-Id: Iad87245bf8082193be72f7e482f29e9f1bad11fc
2023-12-11 16:39:00 +01:00
Reedy 1bc5b6daf8 Namespace classes that need aliases
Change-Id: Ieeeaf80d04b060d6dbca1959d5e66f4c69c5a7f2
2023-08-18 19:00:41 +01:00
Umherirrender 680e91c75c tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: I8b6fbfc300d62a10da770c8a1ca61756c7d7bf59
2023-05-20 20:36:33 +02:00
Kosta Harlan 53efddc825
Don't send page-linked notifications for pages created by bot users
Bug: T318523
Change-Id: I704a2912e0a8b0e996d4e4e0a73f4ed3b9ccf6be
2023-04-28 12:13:04 +02:00
Kosta Harlan 016b25b43a
tests: Add namespace for UserLocatorTest
Change-Id: I329801c0f7fe47730174f533fb5df683f42a8566
2023-04-28 11:58:56 +02:00
Reedy a101ce674c Fix and disable some phpcs exclusions
Change-Id: I2ecaf71c8836d627f20629d667b78ffbf420e4ee
2022-11-12 17:58:13 +00:00
Reedy 5611662f06 Namespace Model
Depends-On: Id28792658de950b99a8786f881563476def59eba
Change-Id: Ib57ea2db947285946f31fa9912b37181044df9d3
2022-11-10 14:25:42 -07:00
Fomafix 096e4a709f Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice.

Change-Id: I395e791aed6cc99b7ce1273f51c292e29360443a
2022-11-08 16:41:24 +00:00
Thiemo Kreuz db79d76d83 Use PHPUnit's shortcuts where it makes sense
Notably: any() is the default anyway. It doesn't really make the
tests more specific or better readable when we repeat it all the
time.

Change-Id: I56d201bfce454587b00015b7208f313dd8ed9624
2022-10-26 11:53:57 +02:00
Umherirrender c81dad3efc Replace deprecated WikiPage::factory/newFromID
Replaced WikiPage::newFromID with newFromTitle,
because a Title object exists and could be reused

Bug: T297688
Change-Id: Ide30f259477ed8e0b48df31f5a23cafeb38d7316
2022-06-03 23:25:37 +02:00
Alexander Vorwerk 449f82faa3 MediaWikiTestCase -> MediaWikiIntegrationTestCase
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34.

Bug: T293043
Change-Id: I68efac2c458748fa3ab16c4c652bd2c4af9cbb75
2021-10-12 00:42:10 +02:00
DannyS712 68f7a9a985 Use WikiPage::doUserEditContent() instead of ::doEditContent()
::doUserEditContent() is available since 1.36 as a replacement
for ::doEditContent(), which has been deprecated. Extension
already requires MediaWiki 1.37+, so the method is always
available.

Bug: T255507
Change-Id: Iee5de356dbccd453a3083e0a58859b4cd83a946b
2021-06-24 05:30:07 +00:00
libraryupgrader b3f948c59c build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: I4b2fb7f46b6c0a5c33a6ad25f085de8ae13eb084
2021-05-04 09:05:15 -07:00
Thiemo Kreuz df6d65a6cf Use monitored getTestUser() in tests if possible
Change-Id: I584d8883f14b2651927890d353b738a02771abea
2021-01-29 18:00:57 +00:00
Umherirrender fba5bcec19 Improve function and property documentation in tests
Change-Id: I90a0c9e7b1ac17edeed5f706a8f968f6d67df56f
2021-01-23 12:54:27 +01:00
jenkins-bot 4b6fc85f39 Merge "Use absolute class names in @covers tags" 2019-10-24 18:37:15 +00:00
Thiemo Kreuz bc3dabf828 Prefer strict assertSame() for all numeric assertions
assertEquals() does not compare the type. It can not only be a float,
it can even be a string. E.g. 9 and '9' are considered equal.

Worst case scenarios are:
* 0 is considered equal to any "falsy" value, including the empty
string.
* 1 is considered equal to true.

assertSame() does not have any of these confusing edge-cases.

Change-Id: Ib6af0fefbbd8856adcf27844bb8ddd8e33ed3f9d
2019-10-23 12:28:30 +02:00
Thiemo Kreuz 967a0b54e9 Use absolute class names in @covers tags
Not all tools require these to be absolute, full qualified class
names. But some do. This does make the code more compatible with all
kinds of tools.

Change-Id: Ie7f9d9469b7a48b2fe908d3428fca9ec0120f855
2019-10-23 12:23:09 +02:00
Thiemo Kreuz c36d2bd0e8 Prefer the …::class feature over hard-coded strings in all tests
The codebase already used the …::class feature in many places. So this
is more for consistency than anything. The …::class feature makes it
much easier to do refactoring in the future.

Note this patch is exclusively touching tests. That should make it
relatively easy to review this. As long as the CI is fine with it, it
should be ok. Right? ;-)

Change-Id: I4d2adee76b4adbc83b2061161fd4e863ba833fcb
2019-02-19 14:35:14 +00:00
Kunal Mehta 59a125fc38 Add @covers tags
Change-Id: Ib8cf432b58470c9218519639379c83254acef1c8
2018-01-23 16:44:45 -08:00
Kunal Mehta aaf061c725 build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.ExtraParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle
* MediaWiki.FunctionComment.Missing.Protected
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I8401abf121a7413fa191d7bc535e0ddd6cf8c3f7
2017-06-22 14:13:28 +00:00
James D. Forrester 8c810dff48 build: Update mediawiki/mediawiki-codesniffer to 0.7.1
Also added "composer fix" command.

Change-Id: I25cb61b3b92798f1259d1575a336e2b056d5764f
2016-12-05 15:54:30 -08:00
Siebrand Mazeland 33126b69aa Update formatting
In preparation of Code Sniffer based updates.

Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
2015-10-03 23:28:54 -04:00
Kunal Mehta c1c91a0c1d Update tests/phpunit for new directory structure
Change-Id: Ic2d5659bb1db89cb62d3703ce59f3e58ba909886
2015-06-15 11:36:02 -07:00
Renamed from tests/phpunit/includes/UserLocatorTest.php (Browse further)