| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is part of the component at
https://phabricator.wikimedia.org/tag/mediawiki-recent-changes/
and
https://www.mediawiki.org/wiki/Developers/Maintainers
and
since Ifac20da51f7e809f under the same "Recent changes" doc group.
The Maintainers list oddly enough lists only rcfeed and completely
forgets the majority of it under /includes/changes (or now,
/includes/recentchanges).
Bug: T364652
Change-Id: I94e6705672c1e2821bdc726aa7a383d9e7c1f7b5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* In the CheckUser extension, a maintenance script named
'purgeOldData.php' purges data from the recentchanges table.
* This script is run on WMF production daily to ensure private
data is purged.
* This should instead be in core, so that the functionality can
be used when CheckUser is not installed and also not duplicate
existing code used for the job that purges the table.
What:
* Create purgeRecentChanges.php which purges expired rows in the
recentchanges table by running the code in the
RecentChangesUpdateJob directly (without using the job queue,
as there is no need to do that because we are in a maintenance
script context).
* Add a test for this maintenance script
* Test the purging features of the existing job to ensure that
this code is reliable.
Bug: T373032
Change-Id: Id32780c00b053d7fec94a00812f8d40a6bf2e40c
|
|
|
|
|
|
|
| |
It adds MediaWiki\Content namespace to WikitextContent
and two classes related.
Change-Id: Ib74e4c5b3edac6aa0e35d3b2093ce1d0b794cb6d
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Replace uses of soon-to-be-deprecated methods:
* ApiBase::errorArrayToStatus
* PermissionStatus::toLegacyErrorArray
Deprecate and replace uses of:
* RecentChange::doMarkPatrolled
Change-Id: I2311d1fa3772ba6be378ad6f497ed4c0df9b7aa8
|
|/
|
|
| |
Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- We cannot save an RC entry when temp user feature is enabled
What:
- Disable auto-create temp user when the user ID in a test case is 0
Bug: T365669
Change-Id: I4191416cb9b80713ed67db71bcd0c7d68c95dde6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A number of tests have hardcoded expections that pass only in WMF CI
where Quibble has LocalSettings.php with $wgScript and $wgArticlePath
set a certain way.
We could fix these by adding setMwGlobals() in their tests, as we
often do, but these are so often forgotten that I'd rather we just
add them to TestSetup.php so that it is simply impossible to write a
test that that passes locally for you (if you have the same config)
but not for someone else.
There is a larger project in there somewhere about expanding this
slowly such that we basically only pluck DB-settings and extension
enablement from LocalSettings and otherwise run the tests with the
default settings in PHPUnit. Pretty much by definition, any (other)
setting you have in LocalSettings is irrelevant because it either:
1. has no effect on the test (majority, harmless either way),
2. has a custom default via TestSetup.php (which has precedence over
LocalSettings.php),
3. is relevant to the code being tested and the test case correctly
calls setMwGlobals() to ensure a consistent value during test.
4. is relevant to the tested code but has no override, thus only
passes if you happen to have the "right" value set for it
(undesirable).
Case 4 is already categorically impossible for the most common config
settings that influence random code because we give them a value
in TestSetup.php. This patch expands that to include $wgScript
and $wgArticlePath. Perhaps in the future we can think about a way
to do this automatically by either re-applying MainConfigSchema
(sans db settings) or by only selectively applying LocalSettings.php
in the first place.
This patch follows-up I072ddf89562fe, which added a test case in
WikitextContentHandlerIntegrationTest.php that assumed "/index.php"
as the value of $wgScript. This passes in WMF CI since Quibble uses
that value, but the tests failed in most local development installs
since those tend to use "/w" instead.
Rather than one-off fixing that one test with overrideConfigValues(),
switch to a more general fixture, since the precise values don't
matter for this test.
Bug: T349087
Bug: T277470
Change-Id: If4304b7ca4a838bd892d4516a0b5c6dfbc30986e
|
|
|
|
| |
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|
|
|
|
|
|
|
|
| |
When running tests together with the CheckUser extension there is a
database error, for RC_LOG both fields must be not-null
Error 1048: Column 'cupe_log_type' cannot be null
Function: MediaWiki\CheckUser\Hooks::updateCheckUserData
Change-Id: I188df89b75a57aa1cc82c77f5c925bee634501cb
|
|
|
|
|
|
|
| |
… replace them with the named convenience methods provided by
PHPUnit.
Change-Id: Ib46dbc3ab7926cf176477254f466b9bdd3be7c46
|
|
|
|
| |
Change-Id: I10cd61f6088da3069d7e29e5fe4355747e83236e
|
|
|
|
|
| |
Bug: T166010
Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
|
|
|
|
|
| |
Bug: T321882
Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The collapsing on the enhanced changes list now works without
JavaScript.
Keyboard navigation is still supported but only the space and not the
return toggles the collapsing toggle button.
The <input type="checkbox"> element needs an unique identifier in the
`id` attribute and the same value must be in the `for` attribute of the
<label> element. A simple counter in the class EnhancedChangesList
starts twice from the beginning if the recent changes get included as:
{{Special:RecentChanges|enhanced=1}}
{{Special:RecentChanges|enhanced=1}}
Therefore a random value is used as checkbox identifier.
The module 'jquery.makeCollapsible' and its classes `mw-collapsible`,
`mw-collapsed` and `mw-collapsible-toggle-collapsed` are not needed
anymore.
The icons from module 'mediawiki.icon' are directly included because the
module has fixed selectors which do not fit here.
Bug: T172618
Change-Id: Iafd27e5d760b78ae386d833946005f86cee8dd64
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Initally used a new sniff with autofix (T333745),
but some provide are defined non-static in TestBase class
and need more work to make them static in a compatible way
Bug: T332865
Change-Id: I889d33424f0c01fb26f2d86f8d4fc3de3e568843
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move the current URL logic from IRCColourfulRCFeedFormatter
to a new method RecentChange::getNotifyUrl (covered by tests now).
* Re-use this method in MachineReadableRCFeedFormatter so that
the diff/patrol/rcid etc URL is also available in the modern
JSON-based EventStreams service. And in particular to allow
porting of the legacy irc.wikimedia.org backend to a much simpler
one that is based on this.
* Also expose a title_url field which was previously missing,
and made consumption of the data needlessly difficult.
Bug: T234234
Depends-On: Id740134ef30b2276688d7b7caedb6bb652158761
Change-Id: Ic3e0aebdb61b5c0e5fbed08656db4a1e90b67518
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
There was no clean way to do this but using the global state.
The parameter is three-state to keep backward compatibility.
Bug: T304428
Change-Id: I01c5f8e9646cbe861516100c3b8d165aefb95ca0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
We should slowly migrate page/ to have proper namespace too but that'll
be pretty big.
Bug: T321882
Change-Id: I3e57be8aa8ac08971f190233196e84ea33023d4a
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
The result of the method has been inappropriate and
surprising since rc_patrolled was changed to distinguish
between manually patrolled and autopatrolled changes
(T184791).
When called with $auto = true, it would mark the change
as manually patrolled (not autopatrolled), but it would
not log it as such in patrol log and would still require
'autopatrol' right (not 'patrol').
Change-Id: I0bd6f2cf317d2b1c8dd50b7998724a57f5f549fb
|
|
|
|
|
|
|
| |
assertSame avoids use of loose comparisons and
allows to check the expected type
Change-Id: If821d1be2bc1ff9f8b70968a339f33c7a8e8880a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* DeprecatedHooksTest: Don't use assertContains().
* Replace uses of deprecated asserts:
- assertFileNotExists() -> assertFileDoesNotExist()
* Update hierarchy of MediaWikiPHPUnitResultPrinter, since ResultPrinter
is an interface in PHPUnit 9.
* Remove temporary forward-compat methods.
* Remove directories that don't exist from tests/phpunit/suite.xml, since
they now make PHPUnit exit:
- tests/phpunit/skins, it used to have SideBarTest, then moved to
tests/phpunit/includes/skins
- tests/phpunit/documentation, it used to have ReleaseNotesTest, then
moved to tests/phpunit/unit/documentation
* Update configuration with --migrate-configuration and reformat.
* Avoid redefining getMockBuilder() in
ActionModuleBasedHandlerTestTrait, use a @method annotation instead.
* In RCCacheEntryFactoryTest, avoid using internal PHPUnit logic for
HTML validation, and use native PHP methods instead. The code was
copied from Xml::load (moved to \Xml\Loader::load in PHPUnit 9) and
simplified for this use case.
Bug: T243600
Bug: T262076
Change-Id: I851b9158b73d0cfc315eed9d63b15c54b05895e3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
And also assertNotRegExp -> assertDoesNotMatchRegularExpression. The
methods were renamed in PHPUnit 9.
Done automatically with:
grep -rl assertRegExp tests/ | xargs sed -r -i "s/>assertRegExp\(/>assertMatchesRegularExpression\(/"
grep -rl assertNotRegExp tests/ | xargs sed -r -i "s/>assertNotRegExp\(/>assertDoesNotMatchRegularExpression\(/"
Split out from Ifdba0f9e98eb6bce4590b7eb73170c51a697d7c6 so that it
remains smaller and easier to review.
Also make a test use MediaWikiUnitTestCase (it's already in the unit/
dir) so that it can access the forward-compat method.
Bug: T243600
Change-Id: Ifa279d5f201d7abeebece292141ebface8278046
|
|
|
|
|
| |
Bug: T297688
Change-Id: Ic84d491c5603f3590e26cb56a305508b2b0ca109
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Directories covered are:
- tests/phpunit/includes/cache/
- tests/phpunit/includes/changes/
- tests/phpunit/includes/changetags/
- tests/phpunit/includes/config/
- tests/phpunit/includes/content/
- tests/phpunit/includes/debug/
- tests/phpunit/includes/deferred/
- tests/phpunit/includes/diff/
Change-Id: I3a1f586867db7d57b177e13a03a4593f7eed09f4
|
|
|
|
|
|
|
|
|
|
|
| |
createMock() does the same, but is much easier to read.
A small difference is that some of the replacements made in this
patch didn't use disableOriginalConstructor() before. In case this
was relevant we should see the respective test fail. If not we can
save some CPU cycles and skip these constructors.
Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
|
|
|
|
|
|
| |
Avoid parsing known titles in tests to improve performance
Change-Id: Ibfccfe696f0b8bfda0b99abae324e60bbecef7d8
|
|
|
|
|
| |
Bug: T259948
Change-Id: I9afcf3b845306f81ee5ca156553256e6c38df3a0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I361fde0de7f4406bce6ed075ed397effa5be3359.
Per T253461, not mass-changing source code, but the use of the native
error silencing operator (@) is especially useful in tests because:
1. It requires any/all statements to be explicitly marked. The
suppressWarnings/restoreWarnings sections encourage developers to
be "lazy" and thus encapsulate more than needed if there are multiple
ones near each other, which would ignore potentially important
warnings in a test case, which is generally exactly the time when
it is really useful to get warnings etc.
2. It avoids leaking state, for example in LBFactoryTest the
assertFalse call would throw a PHPUnit assertion error (not meant
to be caught by the local catch), and thus won't reach
AtEase::restoreWarnings. This then causes later code to end up
in a mismatching state and creates a confusing error_reporting
state.
See .phpcs.xml, where the at operator is allowed for all test code.
Change-Id: I68d1725d685e0a7586468bc9de6dc29ceea31b8a
|
|
|
|
| |
Change-Id: I361fde0de7f4406bce6ed075ed397effa5be3359
|
|
|
|
| |
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
|
|
|
|
| |
Change-Id: I48161585de6f329ec4037156234e0b07b3b837e6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
The following sniffs now pass and were enabled:
* Generic.ControlStructures.InlineControlStructure
* MediaWiki.PHPUnit.AssertCount.NotUsed
npm:
* svgo: 2.3.0 → 2.3.1
* https://npmjs.com/advisories/1754 (CVE-2021-33587)
Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
|
|
|
|
|
|
|
|
| |
Results in passing a user where previously the fallback
to $wgUser was being used, mostly in tests.
Bug: T255507
Change-Id: Iabe24315b23c0ad1272353186425e71974528d23
|
|
|
|
|
|
|
| |
Added deprecation warning
Bug: T276412
Change-Id: I642a2903f7a1d6861dd5e50e8754980adc937c53
|
|
|
|
| |
Change-Id: Ib86399445a77d3005f23ae87d87f3cf742b13b1f
|
|
|
|
| |
Change-Id: I8905d0d69738a1cd6997c104080fdf128d315e8b
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T278459
Change-Id: I144ea130f29ec437302649d86494034af044c524
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's the same and makes the test code much more readable, I
would like to argue.
Because of the was I split all the changes I made into smaller
patches this patch contains some other changes in the same
lines where I could not split them off. E.g. removal of
->any(), which is the default anyway and doesn't do anything.
Change-Id: Ib297b989d4aec33b31a4e33fe9d5032865b39be0
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Ended up using
grep -Prl '\->setMethods\(' . | xargs sed -r -i 's/setMethods\(/onlyMethods\(/g'
special-casing setMethods( null ) -> onlyMethods( [] )
and then manual fix of failing test (from PS2 onwards).
Bug: T278010
Change-Id: I012dca7ae774bb430c1c44d50991ba0b633353f1
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
No integration needed, as long as we don't invoke the real constructor
of ChangesListSpecialPage, which we can avoid by using a mock
Plus a tiny bit of cleanup - don't declare multiple variables at the
same time
Change-Id: Iac9d04e75019d9ea092321481b87756a9bc03055
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Code that needs to store an actor ID in the database to
represent a UserIdentity, or needs to construct a UserIdentity based on
an actor ID loaded from the database, should use the ActorNormalization
service.
Note: The getActorId() method is removed from the UserIdentity interface,
but all concrete classes continue to support it for now.
UsererIdentityValue::getActorId() is hard deprecated and should
be removed in 1.37. It always returns 0.
User::getActorId() is not deprecated at this point.
Bug: T274179
Depends-On: Id2b3ddf6a2a7cdf90f8936a69148d2cce6fde237
Change-Id: I9925906d11e47efaec3c1f48d5cb3f9896a982c1
|