| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
If an object of the wrong kind is passed in any of these parameters,
the code will still throw an error thanks to type hints on the
properties and methods.
Change-Id: Id13b6da96558ff34ee4e6014f4f9ddf2135811a9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly used find-and-replace:
Find:
/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|)
Replace with:
\3 \1 \4
More could be done, but to keep this patch reasonably sized, I only
changed the most obvious and unambiguously correct cases.
In some cases, I also removed redundant doc comments on the
constructor, and re-ordered the properties to match the constructor.
Bonus: Fix some todos in AuthManagerTest.
Change-Id: Ife5313b821cf537984f6de364bfe1d9b4b992a07
|
|
|
|
| |
Change-Id: I6f79b3a36ce6605b86604fa9a99d55e8b8e67f7b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ObjectCache is already doing a lot of factory pattern logic like
creating instances of the various BagOStuff, this should really be
the responsibility of the factory servicet.
This patch introduces a proper factory (ObjectCacheFactory) to handle
the responsibility of creating various instances of BagOStuff. Since
`newFromParams()` is a static function that gets passed in configuration
of $wgObjectCaches, that can stay that way (to keep supporting how we do
this in prod today).
Technical Breaking Change: `ObjectCache::makeLocalServerCache()` now has
a parameter and requires it but there are no callers of this method outside
MW core hence it is safe to change (and this patch update all callers) to
work correctly. Cache prefix is gotten from global state because sometimes
at this stage, the services container is not available.
Bug: T358346
Change-Id: I3179a387486377c6a575d173f39f82870c49c321
|
|
|
|
|
|
| |
Bug: T204787
Bug: T181869
Change-Id: Id180833a9ccf383ce7e0b650aa2fa9d6651d4ad1
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
|
|/
|
|
| |
Change-Id: I562236f45c0fef5ad2b8fba5d3584b4ddd38a17a
|
|
|
|
| |
Change-Id: I849268172751d50292e93aa75abe8094873f56bc
|
|
|
|
|
|
|
| |
Replace strpos with str_contains, str_starts_with, etc.
Fix spelling of "cannot" and other typos.
Change-Id: Ie52900b323f46d1978a9dd9ea3b17619b8942160
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|
|
|
|
|
|
|
| |
Some tests using ReflectionProperty::setValue(), which is deprecated for
static values in php8.3
Bug: T352910
Change-Id: I702cbf3de9c448d0a4e41fd06adc59d4074137cc
|
|
|
|
|
|
|
|
| |
Use local variables instead.
Dynamic properties are deprecated in php8.2
Bug: T326478
Change-Id: If0ebf68a4a4ccd6dbe65c8f6ebd518455ee829bc
|
|
|
|
|
| |
Bug: T166010
Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
|
|
|
|
|
| |
Bug: T321882
Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
|
|
|
|
|
|
|
|
| |
If the test expects the user to exist, it should use getTestSysop to
guarantee the account creation. Otherwise, use mocks or different
usernames to clarify that the username is not relevant to the test.
Change-Id: I87a27f01e1874af410e5d43e2e7fc3b10bb14eb8
|
|
|
|
|
|
|
| |
It's basically only used there.
Bug: T321882
Change-Id: Ibd9cac69772270b50152572ed618c692bbd5e4d9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces the acceptable forms for hook handlers to three things:
* a callable (in the form of a string, an array, or a closure)
* an object, which is expected to have a public "on" method that
matches the hook name.
* an array containing an object spec in the "handler" key, for use
with ExtensionRegistry.
All other forms will trigger a deprecation warning.
Bug: T339167
Depends-On: I980f2d45e6bb8c6a04058e68c758f71bbcf709de
Depends-On: Ieae405f70caa01d84602583cc214b0ee3fadc796
Depends-On: If15df4b598c02ed9bda5eea0ae89a16ebbf4f2e2
Depends-On: Id70276fa1e1821bd400dc0ae5cea722a21d524d5
Change-Id: I83bc81d1b3033c38b9313884a9c70a187fdde227
|
|
|
|
|
|
| |
PasswordSalt was dropped in 2e909bcb
Change-Id: I58d2b8d4e2a235afdc8054eafdea4e85b61f03c1
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Unnecessary regex modifier. I agree with this inspection which flags
/s modifiers on regexes that don't use a dot.
* Property declared dynamically.
* Unused local variable. But it's acceptable for an unused local
variable to take the return value of a method under test, when it is
being tested for its side-effects. And it's acceptable for an unused
local variable to document unused list expansion elements, or the
nature of array keys in a foreach.
Change-Id: I067b5b45dd1138c00e7269b66d3d1385f202fe7f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Prepare phpunit tests for a world where $wgHooks behaves like other
config variables: on-the-fly manipulation doesn't have an effect,
service objects need to be reset after changing it.
Change-Id: I34385f4c52febfe1c91bd7ea4100c06d1331adc8
|
|
|
|
|
| |
Bug: T325687
Change-Id: I8319fc256f95c100aecbc31e24524f0208e3b0d5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Redoing I5ea70120d74 but without moving WebRequest that caused issues
with phan-taint-plugin.
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequestUpload
Bug: T321882
Change-Id: I832b133aaf61ee9f6190b0227d2f3de99bd1717b
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2bdc0b2b7209441a42a784157633a8a01b321922.
Reason for revert: T166010#8349431
Bug: T166010
Change-Id: Idcd3025647aec99532f5d69b9c1718c531761283
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequest
- WebRequestUpload
Bug: T166010
Change-Id: I5ea70120d745f2876ae31d039f3f8a51e49e9ad8
|
|
|
|
| |
Change-Id: Ie2979c49922f732b0a410e304b2219875a5db209
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main object cache is disabled during testing. Some integration tests
need it though. This provides a clean way to enable it, to replace the hacks
that were used so far.
Note that we may want to enable the main cache during testing soon. When
that happens, this method is still useful to disable the cache in certain
tests, and to set a specific cache instance.
Change-Id: I04ae1bf1b6b2c8f6310acd2edf89459d01a9c870
|
|
|
|
|
|
| |
Replace ->will( ->return with ->willReturn(
Change-Id: Ia2dfafa03cac8169d86d6fa5a30b73bfad1fe9fa
|
|
|
|
|
|
|
|
|
| |
The getConfig of a ContextSource should only be used, if the
ContextSource is available. Getting the global context just for the
config looks harder to fix/inject as using the MainConfig from
MediaWikiServices
Change-Id: Iaf14bfc7bd68cc315672e1c256887faf87e22542
|
|
|
|
|
| |
Bug: T254646
Change-Id: Ib192dc5704a14d02c7c374d0ab29bac55c5df24a
|
|
|
|
|
|
|
|
|
| |
Create new SessionProviderTestTrait and
SessionProviderTestTrait::initProvider method. Replace uses of
SessionProvider::init with new method in tests.
Bug: T283709
Change-Id: I2770188faf3e4f374f9df885ff4deff7189063fc
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
init() method was added to SessionProvider. It helps to inject
dependecies. Overridable postInitSetup() method was added to
SessionProvider. A provider can override this to do
any necessary setup.
SessionProvider ::setLogger(), ::setManager(), ::setConfig(),
::setHookContainer() were soft deprecated. Now developers must use
SessionProvider::init()
Bug: T275030
Change-Id: I958797881251572e4ec22e7dd9d13f74f7e216a3
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is the default anyway when using ->with(). The test code
becomes so much more readable without this, I would like to
argue. Let it just say "with these values".
Because of the way I split my changes into multiple patches
there are a few other changes in this patch I could not split,
e.g. removing unnecessary ->any(). This is the default anyway
and doesn't make the test more specific.
Change-Id: I34990799fa9258ba8dc64c7e78ec43f7903b7681
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208
Bug: T274036
Change-Id: I695873737167a75f0d94901fa40383a33984ca55
|
|
|
|
|
| |
Bug: T274036
Change-Id: Ib738ecd3bc23d34900bc268c8246702ac3655746
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Store IP and device information in the session and log when
it changes. The goal is to detect session leakage when the
session is accidentally sent to another user, which is a
hypothetical cause of T264370. The log will be noisy since
users do change IP addresses for a number of reasons,
but we are mainly interested in the ability of correlating
user-reported incidents where we have a username to filter
by, so that's OK.
Based on I27468a3f6d58.
Bug: T264799
Change-Id: Ifa14fa637c1b199159ea11e983a25212ae005565
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is very noisy (logs several times in the same request), but
I'm not sure much can be done about that. It is a flaw in
SessionManager, which does call SessionProvider::persist/unpersist
that many times, and relies on cookie deduplication in WebResponse.
But it should give some idea of when cookies are emitted, and does
not log on normal requests (where no cookies are emitted) so it
shouldn't overload the logging backend.
Bug: T264793
Change-Id: I93733d73af1dfcf539a94b17cf5e4de76cc59748
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)
My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.
Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
|
|
|
|
|
|
|
| |
Follows-up 70cb2664805.
Bug: T234361
Change-Id: Ifd6616b1a31f6cb915ec553865e999fcd974784e
|
|
|
|
|
|
| |
Instead of setting a custom property and checking via isset + count.
Change-Id: I087eeb2eee414218bbd6023ad1703fde22292281
|
|
|
|
|
|
|
| |
Clean up a few more code paths and documentation bits left behind by
Ia53d07cd8ce8ab1497294ea244c13c7499f632c7.
Change-Id: I2bb1749c45bb79b27c5a3b2e1b8ed3395e8c11e0
|
|
|
|
|
|
|
|
| |
PHP 7.3 doesn't like it if session_id() is called when the session has
been started, so we need to be sure to close it first in a few tests.
Bug: T207112
Change-Id: Ief36c1bb7b5c9066f158b5bb0d6d785a7f7ddd3c
|
|
|
|
|
|
|
| |
This is a test mock exclusively used in tests. All code I'm removing here
is unused and neither needed nor covered by any test.
Change-Id: Ifd010c49973460f6fbb2cd83f8fd63488f5fd291
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|