| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Follow move of the tested class
Most moves are part of T321882
Change-Id: I74ab45d6a5331dcb2ff0b65dc2cc7c6315146646
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I6d845bdfbb80, I69b5385868, I4c7d826c7e, I1287f3979ab, which
widened the `@covers` annotations of other test suites:
> We lose useful coverage and spend valuable time keeping these tags
> accurate through refactors (or worse, forget to do so).
>
> I've audited each test to confirm it is a general test of the
> subject class, where tagging missing methods would be an accepted
> change, thus widening it is merely a no-op that clarifies intent
> and reduces maintenance. I am not disabling the "only track coverage
> of specified subject" mechanism, nor am I claiming coverage in
> in classes outside the subject under test.
>
> Tracking this narrow detail wastes time to keep methods in sync during
> refactors, time to realize (and fix) when other people inevitably
> dodn't keep them in sync, time lost in finding uncovered code to
> write tests for only to realize it is already covered but not tagged.
Change-Id: I7555c9b6b5100e861694dada45e691fd306b72be
|
|
|
|
|
|
|
|
|
|
|
|
| |
We renamed many classes to be namespaced, but the `@covers` and
`@coversDefaultClass` annotations weren't updated properly.
PHPUnit didn't support short cover annotations with `use` statements,
these didn't trigger any errors yet, because they are class alias.
This patch is populated by a modified version of PhpunitAnnotationsSniff.
Change-Id: I6c602290a30099239b17d2dc0d67b1488b4eaeeb
|
|
|
|
|
|
|
| |
The following sniffs are failing and were disabled:
* MediaWiki.Usage.ForbiddenFunctions.eval
Change-Id: I6fd0a9296c88a77c3abec6e5e8d568bb469c2d6e
|
|
|
|
|
|
|
|
|
|
| |
To follow Message. This is approved as part of RFC T166010.
Also namespace it but doing it properly with PSR-4 would require
namespacing every class under language/ and that will take some time.
Bug: T321882
Change-Id: I195cf4c67bd51410556c2dd1e33cc9c1033d5d18
|
|
|
|
|
| |
Bug: T253628
Change-Id: I5c64f436d3cf757390b751ce3e34bfc7872bc176
|
|
|
|
|
|
| |
…and avoid the use of MWException.
Change-Id: Id07e301c3f20afa135e5469ee234a27354485652
|
|
|
|
|
|
|
|
|
| |
This reverts commit 27ee63f8c9d97ecc04cee0d7a29deca74b7bea5c.
Reason for revert: Serialized Messages are stored in the database
Bug: T323236
Change-Id: Ia8089201eedf3c0585bb7e970b3776a7e0882019
|
|
|
|
|
| |
Depends-On: I3b893152ed278a72b5e74ccf91a3381f319bfcd9
Change-Id: I9f69a9316eaec23103262ec2ffd5b85baaf16f3f
|
|
|
|
|
|
|
| |
The files in `tests/phpunit/includes/` directory are now all
covered. Will do sub-directories of `/includes/` next.
Change-Id: I8d5655ce267b6d32cf3c7ee40dc5d2992631b5a6
|
|
|
|
|
|
|
|
| |
Depends-On: I4f3b01eccf571475f1248db838a8aa6cba18b93e
Depends-On: I0a0681b332abb623fc6871ab78da9e64a79fad84
Bug: T300069
Bug: T302469
Change-Id: I45f58034117e9041fe5403dbfcf83ba25f20518d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This affects messages created using wfMessageFallback() and related
functions, in particular many messages used for navigation tabs in
skins.
Previous attempt in 11d7d97768fa384102eba4a530a535454ea4aa11,
reverted in c83b530f952286f10c5d9a5bf7960bb6acf7be18 due to T302469.
This attempt doesn't introduce any new placeholders to avoid that
issue.
Bug: T300069
Change-Id: Ib0e282b3864caf345e42dd7af4a529f43ae7ba67
|
|
|
|
|
|
|
|
|
| |
This reverts commit 11d7d97768fa384102eba4a530a535454ea4aa11.
Breaking fundraising banners with regexes in them.
Bug: T302469
Change-Id: I0146a6a2907ca72792375e97a5b5392c6465614f
|
|
|
|
|
|
|
|
|
| |
This affects messages created using wfMessageFallback() and related
functions, in particular many messages used for navigation tabs in
skins.
Bug: T300069
Change-Id: Ia8ba35419285cfa77197810ae9df99e522a0f4ba
|
|
|
|
| |
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
|
|
|
|
|
| |
Bug: T254646
Change-Id: Ib192dc5704a14d02c7c374d0ab29bac55c5df24a
|
|
|
|
|
|
|
| |
* Added ParamType::OBJECT, which allows Stringable objects to be passed into MessageValue
Bug: T278482
Change-Id: Ib4990f87d4ad70b7525d7aa05c8b97e90c121674
|
|
|
|
|
| |
Bug: T278482
Change-Id: I45da5f73f8920b79b57c02776a05d0268d3480f2
|
|
|
|
|
|
|
|
|
| |
Remove Message::$format and the $format parameter of
Message::toString(), soft-deprecated in 1.26 and hard-deprecated
in 1.36. Also make the signature of toString() stricter.
Bug: T146416
Change-Id: I19aa3e482968dea5164afb93b04a55f27c644ce6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Also modified new APIs added to ApiErrorFormatter to
use PageReference instead of Title.
Change-Id: I093c89f8e1e6d383603f887358be6ece70f23a02
|
|
|
|
| |
Change-Id: Ib0e36d767788edcdd8fa9ebc5de6bbde4cf50f12
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is not entirely meaningless. It might be an indicator that
the number of calls to a method is intentionally unlimited.
This is similar to e.g. an @inheritDoc PHPDoc comment that
marks a method as being "intentionally undocumented".
However, what's the meaning of being "intentionally
unconstrained"? Let's just not have any constraint then.
I feel all these ->expects( $this->any() ) bloat the test
code so much that it's never worth it.
Change-Id: I9925e7706bd03e1666f6eb0b284cb42b0dd3be23
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This functionality exists to enable the anti-pattern of calling a
format method, without using its return value, and then subsequently
calling toString() to parse the same message, the same way, a second
time with the format you just called.
For example:
```
$msg = new Message('laggedreplicamode');
echo $msg->plain();
// <strong>Warning:</strong> Page may not contain recent
echo $msg->toString();
// <strong>Warning:</strong> Page may not contain recent
echo $msg->escaped();
// <strong>Warning:</strong> Page may not contain recent
echo $msg->toString();
// <strong>Warning:</strong> Page may not contain recent
```
Deprecate this rare anti-pattern in favour of using the return value
from the formatting methods such as $msg->plain() and $msg->escaped(),
or for compat we can also support $msg->toString('plain') etc.
This commit also fixes an unintentional lie in the assertion message
of one of the unit tests, which was claiming that toString() is
unaffected by format calls, when in fact it is. (And is what we are
deprecating here).
This implicit formatting and the related $this->format field will
be removed in 1.37.
Bug: T146416
Depends-On: Ia257621fb421854bf13e2965b04009663711ba0a
Change-Id: Ibb22099ff8042406e441d6c7fab87537d3ac92aa
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
This is used quite a lot in the codebase and it's
a reason for a lot of usages of $wgLang. Time and date
seems generic enough to put into Message library -
we already have references to Wikimedia\Timestamp
library there.
Bug: T278482
Change-Id: If7cb5f5dcfa736b6530f731af9dc3af168812054
|
|
|
|
| |
Change-Id: Iadc2eabb7d132a21cffccf5468b92328a64acb4a
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is native support for all of this now in PHP, thanks to changes
and additions that have been made in later versions. There should be no
need any more to ever use call_user_func() or call_user_func_array().
Reviewing this should be fairly easy: Because this patch touches
exclusivly tests, but no production code, there is no such thing as
"insufficent test coverage". As long as CI goes green, this should be
fine.
Change-Id: Ib9690103687734bb5a85d3dab0e5642a07087bbc
|
|
|
|
|
|
| |
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
|
|/
|
|
|
|
|
|
|
|
| |
This test has been said to be flaky, and I suppose it could be if
it somehow regularly manages to tick a second in between the two calls
to wfTimestampNow(). So let's make just one call and reuse the value to
see if that fixes it.
Bug: T232266
Change-Id: I8fbdfa2f906839423cc238cd3741b94435a84505
|
|
|
|
|
|
| |
MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass
Change-Id: I63f97497714a32236268be6965c5e181dade6c58
|
|
|
|
|
| |
Bug: T192167
Change-Id: I1ea19e9b53683b7d32ff9836990ee73ab3e11104
|
|
|
|
| |
Change-Id: If6cbdec05b8f310ef3a0b4649aaa16d9fb80a047
|
|
|
|
|
|
| |
Depends-On: Ia70e6c75f6e8a533f20cd44ebb05e013678e9951
Depends-On: I546eda0377f3a50843144b1450d3fbe8e4e02a8a
Change-Id: I305539a8598535a73e5cd280b2becdafa740ef97
|
|
|
|
|
|
| |
Bug: T160811
Change-Id: I0556c04d33386d0339e02e2bf7a1ee74d97c2abd
|
|
|
|
| |
Change-Id: Idb9af9515702ee9748755d7799663713b2283647
|
|
|
|
|
|
|
|
| |
I wasn't sure how to convert the rest of the occurrences in core (there
are a significant number).
Bug: T200881
Change-Id: I114bba946cd3ea8a293121e275588c3c4d174f94
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids error-prone code written separately in every test. In
addition to no existing tests resetting the TitleFormatter (more
services probably need to be reset as well), they mostly reset only the
namespace cache on $wgContLang, which wouldn't help for any other
language.
The parser test runner still doesn't do this, but maybe it should.
Change-Id: I44b7a1aec48f14b0950907fa14bd0df80f674296
|
|
|
|
|
|
|
|
| |
Deprecate the unnamespaced version and move it to includes/compat.
Bug: T147167
Depends-On: I39c805bfb98b32f32f3d0dc1eee9e823afe1c21a
Change-Id: I3780c7adf51683f3f7adb35a88f9a25a0a2e2530
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
|
|
|
|
|
|
|
| |
MessageTest did not have the group at class level
either so that is added in this patch.
Change-Id: Idb6213282d6854044f374c9df51ea32d0a5523e1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replaces \TestingAccessWrapper (defined in core) with
\Wikimedia\TestingAccessWrapper (defined in the composer package
wikimedia/testing-access-wrapper).
See https://gerrit.wikimedia.org/r/#/q/topic:librarize-testing-access-wrapper
for downstream patches.
The core version of the class is kept around for a while to avoid
circular dependency problems.
Bug: T163434
Change-Id: I52cc257e593da3d6c3b01a909e554a950225aec8
|
|
|
|
|
|
|
|
|
|
| |
System messages may take parameters from untrusted sources. This
may include taking parameters from urls given by unauthenticated
users even if the wiki is a read-only wiki. Allowing <html> tags
in such a context seems like an accident waiting to happen.
Bug: T156184
Change-Id: I661f482986d319cf41da1d3e7b20a0f028a42e90
|
|
|
|
|
|
|
|
|
|
| |
I was bored. What? Don't look at me that way.
I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.
Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
|
|
|
|
|
|
|
| |
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.
Change-Id: I46261416f7603558dceb76ebe695a5cac274e417
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old code was similar to Message::params(), but Message::params()
was unable to handle "special" parameters and received an overhaul
in 7f2663f, yet wfMessage remained broken. To avoid duplication,
wfMessage shall call Message::params() to correctly handle these
parameters.
CategoryMembershipChange::getChangeMessageText and its caller has
been updated so as not to take advantage of this bug.
Bug: T153747
Change-Id: I6667acf7e71c9db07fefc9fbb741c160e15823ff
|